Filter Order by

Status
Not open for further replies.

dimoss

Well-Known Member
Hi

It seems that the Order by drop down doesn't work. It should order by label when I choose this but it doesn't work. Whatever I choose it's always sort by id value.

I use the latest githaub ver.

Thanks

Dimos
 
What is your element type?

With a database join "Order by"= "Label", "value" and "none" is working on my site if no concat label is defined (with concat label "Label" is also ordering by value).
 
Hi Troester

The element is dbjoin.
The value is the id of the joined list.
The label is a field element of the joined list.

No concat label is defined.

Thanks

Dimos
 
Strange.
What happens if you put

order by a-db-column

in the "Joins where and/or order by statement (SQL)" field and select "none" for the Filters "Order by"?
 
Hi again

If I put ORDER BY the joined list column I take the correct order ONLY if I choose the 'None' option.

Dimos
 
This is the expected behaviour (choosing "none" should take the ORDER BY)

So this would be a workaround with "ORDER BY your-label" and choosing "none"?

No idea why it's working on my site and not on yours with "Label". Is there anything else e.g. element is in a joined or repeated group, child element...?
 
Like troester, I can't replicate this. The ordering of the filter dropdown on a db join works fine with a simple (non concat'ed) label.

Can you enable Fabrik debug (in the global settings), append &fabrikdebug=1 to your list URL. You should get some debug output, including a line that says something like "Element filterValueList_exact" (exact name will depend on your filter settings). Should be obvious which one belongs to the filter you are having issues with.

For instance, here's mine for a 'US States' join element:

Code:
SELECT DISTINCT(CONCAT(us_states.name, ' (', us_states.abbr, ')')) AS `text`, `fab_main_test`.`state` AS `value` FROM `fab_main_test` LEFT JOIN `us_states` AS `us_states` ON `us_states`.`abbr` = `fab_main_test`.`state` LEFT JOIN `us_cities` AS `us_cities` ON `us_cities`.`id` = `fab_main_test`.`city` LEFT JOIN `us_states` AS `us_states_0` ON `us_states_0`.`abbr` = `fab_main_test`.`other_state` LEFT JOIN `fab_junk` AS `fab_junk` ON `fab_junk`.`id` = `fab_main_test`.`junk_join` WHERE `fab_main_test`.`state` IN ('AL','NM','AK','ME','CA','GA','AR') ORDER BY `us_states`.`abbr`ASC

OBTW, note that this also illustrates the "CONCAT label bug" .... we correctly create the actual label as the concat, but order by the non-concat label selection.

Anyway ... see if you can find that query in the debug output, and copy and paste it here.

-- hugh
 
Hi Hugh

The query is:

SELECT DISTINCT(`pdan_users`.name) AS `text`, `fab_adeies`.`create_user` AS `value` FROM `fab_adeies` INNER JOIN `#__users` AS `pdan_users` ON `pdan_users`.id = `fab_adeies`.`create_user` WHERE `fab_adeies`.`create_user` IN ('277','280','281','395','391','471','392','274')
 
Hmmm, for whatever reason, it's not doing any ordering at all.

I'll have to get my hands on your site to debug this one, but I'm currently swamped with higher priority issues, and given that you have a workaround, we'll have to come back to this one at a later date.

-- hugh
 
Hi again

The problem persists. It seems that even I have chosen 'Order by label' it continues to order by id.

The same is fixed on 3.6.0.3 version downloaded from the download section.

Thanks

Dimos
 
Friendly bump.

I installed the new 3.0.7 version on a fresh Joomla.

The problem persists and it appears on the dbjoin and the CDD elements.

On the other elements seems to work ok.
 
OK, I think all the join/CDD "Please select" issues are now sorted out, in list filter view and form view.

-- hugh
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top