HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS. ocPortal 9 is superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Catalogue entries failing to sort by title

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#112153 (In Topic #22592)
Avatar

Well-settled

Greetings,

On my OcP v.9.0.16 website I have a vitally important custom catalogue for entries giving data on research-related scientific publications and resources accessible online, incorporating several child categories. As of yesterday, following a simple Search query, the categories' list of entries, configured to be sorted by ascending title, now  lists them sorted by date added; the "Sort by" feature responds to most of its given options, except for sorting by title (either ascending or descending), which is essential. No error messages are returned in response to switching the sorting criterion.

I've had no joy with more obvious troubleshooting steps - checking the catalogue's default field for sorting by, checking other catalogues' behaviour, clearing system caches, trying alternative browsers, or checking for indicated database table corruptions with phpMyAdmin. The problem doesn't reproduce on my v.9.0.37 website, running on the same hosted server and domain-name. The problem, then, seems specific to that one catalogue. I'm now suspecting some kind of system-file issue as accountable, but haven't the knowledge to investigate that. 

Please can anybody offer me any help remedying this?

Many thanks for reading!

Richard


Back to the top
 
Posted
Item has a rating of 5 (Liked by RichT)  
Rating:
#112154
Avatar

Hello,

I believe you have reached a limit of 300 records for a translatable/Comcode field.

This is a hard-coded limit. We should have documented it (and will now), but it's there for good reason, sorting on this kind of field can be very slow.

If you want to manually raise the limit you'll need to edit sources/catalogues.php by hand:

Code

               $entries=($max==0)?array():$GLOBALS['SITE_DB']->query('SELECT e.* FROM '.$join.' WHERE '.$map.' '.(($num_entries>300)?'':'ORDER BY t.text_original '.$direction) /* For large data sets too slow as after two MySQL joins it can't then use index for ordering */,$max,$start);
Change the number 300 to a higher number on that line.

If you find your performance is too slow you'd need to somehow convert the field to a non-translatable version. That'd probably involve re-creating the catalogue combined with the export CSV and import CSV features.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Support me on Patreon
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#112155
Avatar

Well-settled

Update: Just now found the "by title" sort working again for all except one of the catalogue's categories - one containing 600 entries (much larger than the rest) and four child categories (all of which are sorting correctly!). I had just previously enabled a "Display Search/feature" setting in one of the catalogue's custom fields (the catalogue is configured to display title-lists, which supposedly aren't affected by enabling/disabling that setting!) All very bizarre! 
Back to the top
 
Posted
Rating:
#112156
Avatar

Well-settled

Many thanks for your reply, Chris (which arrived as I was writing my situation-update post just now). 

I'll change that setting as you advise, of course - though the category in question long ago exceeded the default 300-entry limit, so the issue's appearance only yesterday seems equally strange. Anyway, I'll report back ASAP with the result of re-setting that max value. Thanks again!
Back to the top
 
Posted
Rating:
#112157
Avatar

Well-settled

Hi Chris,

Yes, indeed that was the cause. My 9.0.16 version of catalogues.php doesn't actually include the line you quoted (its entire coding strategy is different for this sorting function) , but I found 2 subroutines (lines 527 and 552) starting  

Code

if ($num_entries>300)
and reset them to >1000. Immediately fixed the still-outstanding category, and no conspicuous slowing, either. Can you give me an idea, above what number of entries would you expect the slow-down to become really noticeable?

Many thanks indeed for your ever generous help, Chris!

Good wishes, and I hope you're keeping well.

Richard
Back to the top
 
Posted
Rating:
#112159
Avatar

Great.

Can you give me an idea, above what number of entries would you expect the slow-down to become really noticeable?

It would be a wild guess honestly. We set these kinds of limits fairly intuitively and conservatively. Any answer I gave would depend on MySQL version, server load, server specs.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Support me on Patreon
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: