Search in support tickets

#545 – Field with Values from Database sorting is missing

Posted in ‘Support’
This is a public ticket. Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.
Tuesday, 12 March 2019 10:53 CET
thomaska
Joomla! version : 3.9.3
PHP version : 7.2
AdsManager version : 3.2.3

I created a field named ad_brands and i configure it to retrieve values from a database table.
I create the database table and insert the name/value records unsorted.
So how do i configure the field to sort the values from the database table because the query looks like it does not sort the values?

See the values in the select dropdown box which are not sorted...


BR

Thomas
Custom Fields
Joomla Version
3.9.3
PHP Version
7.2
Product
AdsManager
Product Version
3.2.3
Attachment
Tuesday, 12 March 2019 11:17 CET
thomaska
Hi again. I just fixed the sorting in selectbox when the values are from db.
In the file components/com_adsmanager/helpers/field.php there is three lines that checks if the values are from the database.
The lines are
field.php(76)
field.php(354):
field.php(745):

Inside that if statement, if the values are from the db then there is a line with the query that retrieves the values from the database.
You have to add the ORDER BY clause in those queries in order to get the values sorted.

TIP:
Be carefull the name column because in the first query the name column is `$name` but in the rest two queries is `$_name`.
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.