Page 1 of 3
New entries on top
Posted: 01 Feb 2017, 01:38
by rosede
I just stood up a new Joomla site. Migrated all of the guest book entries from the old version to the new version, 3.0.5. I just received my first entry, and it is at the end of the posts, not at the top like it should be. I don't see anything in the options to ensure that new entries are on top. How can I force new entries to be first in the list?
Thank you.
Daryl
Re: New entries on top
Posted: 03 Feb 2017, 00:00
by Jan
Hi, did you follow this guide:
https://www.phoca.cz/documents/50-phoca/ ... o-joomla-3
including the sql queries for the Phoca Guestbook to set up the ordering?
Jan
Re: New entries on top
Posted: 04 Feb 2017, 00:58
by rosede
Yes, I used that document to migrate users from the old version to the new version.
The order of the entries after the migration are fine, its the new entry that was posted once the new guestbook was put up that is the issue.
Is there something in the database that I need to change?
Thank you
Daryl
Re: New entries on top
Posted: 05 Feb 2017, 18:53
by Jan
Hi, really hard to say what can be wrong there. I got the last queries by users when they had similar problems and such solved the ordering problems. Including new posts which were then ordered the right way
Jan
Re: New entries on top
Posted: 06 Feb 2017, 18:08
by rosede
Jan wrote:I got the last queries by users when they had similar problems and such solved the ordering problems. Jan
Jan,
I don't understand what you mean.
Thank you
Daryl
Re: New entries on top
Posted: 10 Feb 2017, 16:32
by Jan
Some users had the same problem like you have and solved it by the queries set in the guide (the last database queries in the guide - for Phoca Guestook) - after running the queries, the adding of new posts was standard
Jan
Re: New entries on top
Posted: 11 Feb 2017, 02:19
by rosede
Jan wrote:Some users had the same problem like you have and solved it by the queries set in the guide (the last database queries in the guide - for Phoca Guestook) - after running the queries, the adding of new posts was standard
Jan
Can you please show me which query I need to run to resolve this issue? This is a live guestbook, and I don't wan to monkey around with the database unless I know exactly what I need to do.
Thank you.
Daryl
Re: New entries on top
Posted: 16 Feb 2017, 16:19
by rosede
Jan,
I finally had a chance to look at the database table "phocaguestbook_items".
The latest entry, the one that is sorted at the end, had an ID of 239. In column "lft" a value of "2" and in column "rgt" a value of "3". The entry prior to that one have values of ID=226, lft=299 and rgt=300. All of the entries prior to that were in the correct sorted order. I changed the values lft and rgt to 299 and 300 respectfully, and the entry is now showing at the top in the guestbook as it should be.
As I mentioned before, I followed the documentation, and from what I see, all of the previous entries are sorted correctly, that means that I followed the document correctly. When I sort the table on the ID value and put the earliest entries at the top of the table (BTW, I'm using phpMyAdmin to edit the database) I see that ID "1" has lft=5 and rgt=6. It appears to me that Phoca Guestbook is adding the new entries where there are available lft and rgt openings, not values that are the next in order.
Thanks
Daryl
I am adding an update to this posting.
I decided to add several "test" guestbook posting. All of the test entries were added with lft and rgt values of 4, 5, 6, 7 etc.... The existing entries were incremented in their values as well. So, no matter how many "Test" entries I add, they will all go the the lowest value in the lft and rgt columns.
Thank you.
Daryl
Re: New entries on top
Posted: 16 Feb 2017, 19:59
by Jan
Hi, is the id of guestbook still the same? (guestbook = category)
Re: New entries on top
Posted: 18 Feb 2017, 02:37
by rosede
Jan wrote: ↑16 Feb 2017, 19:59
Hi, is the id of guestbook still the same? (guestbook = category)
Yes. The guestbook ID is 20. I verified that every single entry has the same catid number, 20.
Daryl