Hi,
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:
http://symphonya.unimib.it/search/authors/view?firstName=Silvio%20M.&middleName=&lastName=Brondoni&affiliation=&country=
I think the problem is in the code that do extraction of articles, the function getPublishedArticlesForAuthor inside
classes/article/AuthorDAO.inc.php.
The relevant code is:
$params = array(
'affiliation',
$firstName, $middleName, $lastName,
$affiliation, $country
);
if ($journalId !== null) $params[] = (int) $journalId;
$result =& $this->retrieve(
'SELECT DISTINCT
aa.submission_id
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 (aa.country = ?' . (empty($country)?' OR aa.country IS NULL':'') . ') ' .
($journalId!==null?(' AND a.journal_id = ?'):''),
$params
);
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],
see: http://stackoverflow.com/questions/8746519/sql-what-is-the-default-order-by-of-queries
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.
Bye
Zeno Tajoli