Sorting of articles in "Author Details" page is impredicible

I’m working on OJS 2.4.8 with DB on PostgreSQL.
If I go inside the list of articles done by an author, the sort of article is impredicible.
To arrive:
Browse → By Author->Author name.
An live example:

I think the problem is in the code that do extraction of articles, the function getPublishedArticlesForAuthor inside
The relevant code is:

 $params = array(
                        $firstName, $middleName, $lastName,
                        $affiliation, $country
                if ($journalId !== null) $params[] = (int) $journalId;

                $result =& $this->retrieve(
                        'SELECT DISTINCT
                        FROM    authors aa
                                LEFT JOIN articles a ON (aa.submission_id = a.article_id)
                                LEFT JOIN author_settings asl ON (asl.author_id = aa.author_id AND asl.setting_name = ?)
                        WHERE   aa.first_name = ?
                                AND a.status = ' . STATUS_PUBLISHED . '
                                AND (aa.middle_name = ?' . (empty($middleName)?' OR aa.middle_name IS NULL':'') . ')
                                AND aa.last_name = ?
                                AND (asl.setting_value = ?' . (empty($affiliation)?' OR asl.setting_value IS NULL':'') . ')
                                AND ( = ?' . (empty($country)?' OR IS NULL':'') . ') ' .
                                ($journalId!==null?(' AND a.journal_id = ?'):''),

There isn’t a sort inside those SQL.
In MySQL with InnoDB table there is a default on primary key of the table [a.article_id I think],

In PostgreSQL no default at all

It is possible to add an explicit sort by article id ?
So for MySQL installations nothing change, and for PostgreSQL we have an order.

Zeno Tajoli

Hi @ztajoli,

Yes, I think it would be appropriate to add a sort – but why the article ID? I think off the top of my head that users might expect an alphabetical listing by title.

Alec Smecher
Public Knowledge Project Team


in fact an alphabetical listing by title, but it is a change of present
situation on MySQL default setup.
For my users (on PostgreSQL) it is OK, probably they prefer as solution
an alphabetical listing by title.

Hi @ztajoli,

I doubt anyone will mind a change of ordering if they’re using MySQL, as the current ordering doesn’t provide useful information to the user. In any case, you can get a “sorting title” from the article_settings table by looking for the entries with setting_value='cleanTitle'.

Alec Smecher
Public Knowledge Project Team