posts order not according to setting

Phoca Guestbook - creating guestbooks in Joomla! CMS
zerofield
Phoca Member
Phoca Member
Posts: 20
Joined: 17 Sep 2014, 12:34

posts order not according to setting

Post by zerofield »

Today I've stumbled into the following challenge:
- when a page/menu item is setup to list all guestbook posts ascending based on date, they are shown as if the order option 'Manual(Date but can be changed by admin)' was selected. Basically there is no difference in the result on the front page between these two settings. As result from this issue all new entries(no matter what the assigned date is in relation to the timeline) end up on top on the front page(or different if I alter the order in the admin page).
As long as every post came in chronological there was no issue, hence why we didn't notice this problem earlier. Lately some posts where added with dates somewhere in the middle of the timeline. So when order type is set to date, corresponding new posts should listed somewhere in between the already existing posts(which currently doesn't happen).

Guestbook version v3.04(update didn't make any difference). Joomla 3.4.5

Any hints on where display list generation of all posts in php touches with the list order setting from the menu item? Or a solution would even be more appreciated:)
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: posts order not according to setting

Post by Jan »

Hi, try to check the settings (options) in menu link to guestbook (if the ordering is not overriden by menu link).

The second problem which this can be:

Try to open:
components/com_phocaguestbook/models/guestbook.php
Change Line cca 305
from:
$order = $params->get('items_order', 'odering');
to:
$order = $params->get('items_orderby', 'date');

Try to change it and let me know, if there were some changes :idea:

Jan
If you find Phoca extensions useful, please support the project
zerofield
Phoca Member
Phoca Member
Posts: 20
Joined: 17 Sep 2014, 12:34

Re: posts order not according to setting

Post by zerofield »

Sorry maybe I overlooked things, but I checked several times and I can not find a list order setting in the component options. It only exists in the menu link properties. So I don't see what can be overridden.

Option 2 seems to fix the problem :) Thanks. To be precise I've altered the code to $order = $params->get('items_order', 'date);
Not to $order = $params->get('items_orderby', 'date'); as suggested.

Now the followup for improvement; how can we make it depending on the setting made in the menu link parameters?
Based on how the code that I had to alter, it looks like the setting is not captured as a variable from the menu link parameters. Would it be possible to release a fix in terms of an update?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: posts order not according to setting

Post by Jan »

Hi, yes, sorry for confusing, the ordering is now only in menu link options.

Not sure what you mean? The parameters are working this way in Joomla!

- you can set them in Options of extensions and if the same parameter exists in menu link options to the extension, then you can set it there and the options in extension will be overriden. So if you set something in Options and then you create two menu links, each can have other settings.

Jan
If you find Phoca extensions useful, please support the project
Post Reply