[SOLVED] Search breaks when sorted by custom field (date)

More
9 years 8 months ago - 9 years 8 months ago #62037 by Ninjakitten
Search is working fine if any of the built-in options are used (including the ones that go by date, such as 'Added -- Oldest First'), but it fails when told to sort by a custom date field. This is true if I tell it to sort on that field as the default via back-end settings (which is really what I want to do) or if I allow a drop-down on the front-end results page and choose to sort from the field there. It causes a 404 error.

I notice that all of the built-in sorts seem to have a letters-only, one-word orderby such as 'date' or 'rdate'. The custom one is trying to use &orderby=custom%3A17%3Adate%3Aasc and I wonder if that's somehow involved the issue? I tried replacing the %3As in the URL with : (since I believe that's the equivalent) and pressing enter, but it was still 404 so at least the encoding there probably isn't the problem.

I'm using FC 3.0.14-rc2a on Joomla 3.5.1.
Last edit: 9 years 8 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
9 years 8 months ago - 9 years 8 months ago #62038 by ggppdk
Hello

a fix was made on February 13, that fix is included inside v3.0.14-rc2a

i have tested just now and it works


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!
Last edit: 9 years 8 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
9 years 8 months ago - 9 years 8 months ago #62039 by ggppdk
Hello

the change history for the file, fix was added in 3rd commit of February 13
github.com/FLEXIcontent/flexicontent-cck...h/flexiadvsearch.php

maybe not all your files were updated, in your installation, try to re-upload v3.0.14-rc2a


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!
Last edit: 9 years 8 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
9 years 8 months ago #62043 by Ninjakitten
No, sadly, that doesn't appear to be the same issue. I've reuploaded it anyway to be sure, and the error remains.

Please Log in or Create an account to join the conversation.

More
9 years 8 months ago #62044 by ggppdk
Hello

PHP version ?

also enable in Joomla global configuration
- Joomla Debug (inside System TAB)
- error reporting (inside Server TAB)

and retry to see, if you get the error text to appear


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
9 years 8 months ago #62060 by Ninjakitten
It's possible the PHP version could be an issue -- it's 5.3.24, and I can't get my hosting to update it further. (Very frustrating.)

...okay, I have found what's happening. In the SQL when it's trying to use the custom date for sorting, the SQL tries to alias two different tables as 'f':
Code:
JOIN jos_flexicontent_fields as f ON f.id=ts.field_id LEFT JOIN jos_flexicontent_fields_item_relations AS f ON f.item_id = i.id AND f.field_id=17
Do you want/need the entire error (1066 - Not unique table/alias: 'f' SQL = <the whole query>)?

Please Log in or Create an account to join the conversation.

More
9 years 8 months ago #62061 by Ninjakitten
I believe I've fixed it -- it appears to be working now, though I don't know yet if I might've broken something else!
In flexiadvsearch.php I've changed:
Code:
$join_textfields = ' JOIN #__flexicontent_fields as f ON f.id=ts.field_id';
to
Code:
$join_textfields = ' JOIN #__flexicontent_fields as fi ON fi.id=ts.field_id';
on (what is at least for me) line 591 and
Code:
', GROUP_CONCAT(ts.search_index ORDER BY f.ordering ASC SEPARATOR \' \') AS text'
to
Code:
', GROUP_CONCAT(ts.search_index ORDER BY fi.ordering ASC SEPARATOR \' \') AS text'
on line 710.

This appears to have fixed the custom ordering both when set from the backend in the search menu item, and when done from a frontend drop-down.

Please Log in or Create an account to join the conversation.

More
9 years 8 months ago #62062 by Ninjakitten
Hmm. Odd remaining issue: level 1 sorting is working fine now, but level 2 (which is supposed to be 'ordering in current category') seems only to work if I tell the level 2 ordering drop-down to be displayed on the frontend. If that drop-down isn't shown, the current category sorting for items with the same date doesn't happen. If it is, it does. This seems to be entirely independent of whether the level 1 dropdown is shown -- it's only the level 2 one that matters.

Please Log in or Create an account to join the conversation.

More
9 years 8 months ago - 9 years 8 months ago #62063 by ggppdk
Hello

both of these are already fixed

You can get a 3.015-dev build from here
github.com/FLEXIcontent/flexicontent-cck/releases

or download the v3.0.15-stable branch from here:
github.com/FLEXIcontent/flexicontent-cck/tree/3.0.x-stable
(click download ZIP)

[EDIT]
you may want to do "fix permissions" with admin tools before you upgrade
after you upgrade, please check this file has been updated (compare it with file in the package):
flexiadvsearch.php


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!
Last edit: 9 years 8 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
9 years 8 months ago #62064 by Ninjakitten
No, I'm sorry -- I used the 15-dev build, confirmed it did update flexiadvsearch.php, and am back to the same 1066 error. My edit as listed above (now lines 639 and 758) seems to have gotten it working again, so no, I'm afraid this was not already fixed.

It also still won't do the level 2 part of the sorting (the order in category) unless the level 2 drop-down is enabled (showing). No change has to be made in that drop-down; order in category is what I've set as the default level 2 sorting criterion, and IF the level 2 drop-down is shown, it works. If it's hidden, it does not.

Neither issue seems to be addressed in 15, but at least the 1066 error still resolved with the edits I made above.

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save