Hi!
I've installed the Versioning plugin some days ago after having ~60 entries and I had to edit some old entries after the install.
First I've saved the old again, 'cause it wasn't saved after installing the plugin.
Second I've edited the stuff I wanted to and saved.
This led me to correct numbers like:
Revision #2 on 15.10.2008 01:48 by GHoSt
Revision #1 on 15.10.2008 01:44 by GHoSt
That first change were only some typos. I've made another change at the same day in the evening and landed into this:
Revision #2 on 15.10.2008 01:48 by GHoSt
Revision #2 on 15.10.2008 22:47 by GHoSt
Revision #1 on 15.10.2008 01:44 by GHoSt
Shouldn't be the middle one above the first one and shouldn't it have #3?
I've thought I did something wrong, 'cause I've edited in the archive without clicking on the last revision first. So I've tried it with another entry and the result is likely the same.
Revision #2 on 13.10.2008 19:15 by GHoSt
Revision #2 on 14.10.2008 23:13 by GHoSt
Revision #1 on 13.10.2008 18:57 by GHoSt
Again a problem with date and number.
I don't know what the problem is, maybe it's me?!
/EDIT:
Found one I've edited four times now and this is how it looks like:
Revision #2 on 15.10.2008 19:49 by GHoSt
Revision #2 on 15.10.2008 23:39 by GHoSt
Revision #2 on 17.10.2008 14:22 by GHoSt
Revision #1 on 15.10.2008 19:48 by GHoSt
Wrong revision number with versioning plugin
It hadn't to do with increment of the ID, but it had to do with the version column. I've looked through the code and found the problem and a solution!
Find in serendipity_event_versioning.php
Replace with:
It's working fine for me now and I've edited the wrong numbers to the correct ones with phpMyAdmin.
Now I've got this:
Revision #5 on 17.10.2008 15:30 by GHoSt
Revision #4 on 17.10.2008 14:22 by GHoSt
Revision #3 on 15.10.2008 23:39 by GHoSt
Revision #2 on 15.10.2008 19:49 by GHoSt
Revision #1 on 15.10.2008 19:48 by GHoSt
Find in serendipity_event_versioning.php
Code: Select all
GROUP BY v.entry_id, v.id, a.realname, v.version_date";
Code: Select all
GROUP BY v.entry_id, v.id, a.realname, v.version_date
ORDER BY v.version DESC";
Now I've got this:
Revision #5 on 17.10.2008 15:30 by GHoSt
Revision #4 on 17.10.2008 14:22 by GHoSt
Revision #3 on 15.10.2008 23:39 by GHoSt
Revision #2 on 15.10.2008 19:49 by GHoSt
Revision #1 on 15.10.2008 19:48 by GHoSt
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Thanks a lot for the contribution, I added your patch to the repository!
Regards,
Garvin
Thanks a lot for the contribution, I added your patch to the repository!
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
As I've installed the plugin after I've done some entries I've noticed an error at the very bottom of the page if no version info exists, due to the foreach stuff inside the code. I'm too lazy to edit nearly 60 entries now, but made a little change in the code. (yeah funny, I'm not too lazy for this
)
So here's a quick&dirty nighthack from a lazy ghost
Find in serendipity_event_versioning.php
Add BEFORE:
Find:
Add AFTER:
Maybe someone could use this, too
As I've said it's quick&dirty. I've figured out that count($versions) is always 1, but if one or more version info/s exists for that entry $versions[0] is an array (so it's not empty). Maybe it's a strange solution... Guess I need some sleep now 
So here's a quick&dirty nighthack from a lazy ghost
Find in serendipity_event_versioning.php
Code: Select all
$msg = '<div class="serendipity_versioningInfo">' . VERSIONING_TITLE . ':<br />%s</div>';
Code: Select all
if (!empty($versions[0])) {
Code: Select all
$html .= '</ul>';
Code: Select all
}
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
I used your patch in a slightly different way (that requirered no further indentation):
Thanks a lot for your contributions!
Regards,
Garvin
I used your patch in a slightly different way (that requirered no further indentation):
Code: Select all
$versions = &$this->getVersions($eventData[0]['id']);
- if (count($versions) < 1) {
+ if (count($versions) < 1 || empty($versions[0])) {
return true;
}
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/