Sorting series in drop down menu

For discussion of ideas, functional requirements, interests regarding the Open Monograph Press.

Moderators: jmacgreg, John

Forum rules
The Public Knowledge Project Support Forum is moving to

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.
Posts: 81
Joined: Wed Feb 06, 2013 1:49 pm

Sorting series in drop down menu

Postby stefan » Mon Sep 16, 2013 12:32 am


We have several series right now and they are not sorted in the drop down menu of "browse a series".

Is there anything we can do about this?



> You cannot make another post so soon after your last.

Could you remove this restriction for me. I am not a robot. I swear!



Site Admin
Posts: 910
Joined: Tue Jan 10, 2006 6:20 am

Re: Sorting series in drop down menu

Postby JasonNugent » Mon Sep 16, 2013 7:39 am

Hi Stefan,

To do this, you'll need to make a modification to the file classes/press/ There is a function in that file called getByPressId(). You'd need to replace it with:

Code: Select all

    * Retrieve all series for a press.
    * @return DAOResultFactory containing Series ordered by sequence
   function getByPressId($pressId, $rangeInfo = null) {

      $params[] = 'title';
      $params[] = AppLocale::getPrimaryLocale();
      $params[] = 'title';
      $params[] = AppLocale::getLocale();
      $params[] = (int) $pressId;

      $result = $this->retrieveRange(
         'SELECT s.*, COALESCE(stpl.setting_value, stl.setting_value) AS series_title FROM series s
         LEFT JOIN series_settings stpl ON (s.series_id = stpl.series_id AND stpl.setting_name = ? AND stpl.locale = ?)
         LEFT JOIN series_settings stl ON (s.series_id = stl.series_id AND stl.setting_name = ? AND stl.locale = ?)
         WHERE press_id = ? ORDER BY series_title',

      return new DAOResultFactory($result, $this, '_fromRow');

If that works for you, I can make a general commit to our github repo.


Posts: 81
Joined: Wed Feb 06, 2013 1:49 pm

Re: Sorting series in drop down menu

Postby stefan » Tue Sep 17, 2013 7:35 am

Thanks! That works. I am not a developer and it is your code. It would be great if you could check this in. Thanks!

Best wishes


Return to “OMP Discussion”

Who is online

Users browsing this forum: No registered users and 2 guests