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, which is now in beta. ocPortal 9 will be 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.


[Fixed][Bug] Updating catalog category entry quantites

Login / Search

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

Community saint

When using the expiry feature to auto-move catalog category entries, the category screen does not reflect the changes of the number of entries. Manually moving entries will update the category screen.


I added 2 entries to the "New Stable Releases" category and set the expiry to auto-move to the "Stable Releases" category. The entries moved as expected but the category listing screen never updated to reflect the move.

Steve
Back to the top
 
Posted
Rating:
#85699
Avatar

You're right. For performance, since v8 we now have a cache for these tallies. However the movement hook isn't maintaining them. Doing something manually in the category will enforce a refresh. Here is the fix:
Attachment
sources\hooks\systems\cron\catalogue_entry_timeouts.php
» Download: catalogue_entry_timeouts.php (1.86 Kb, 71 downloads so far)


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
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 ocPortal whenever you see the opportunity.
  • 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 ocPortal 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:
#85896
Avatar

Community saint

This didn't appear to work. i'm giving it another test before I make an official failure report.

Any way to have less than a one-day expiry time?

Steve
Back to the top
 
Posted
Rating:
#85901
Avatar

No but you could test by fiddling the ce_add_time field in the ocp_catalogue_entries table, for the particular test entry. Then call up /data/cron_bridge.php by hand which should run right away (it doesn't limit itself to daily or anything like that).


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
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 ocPortal whenever you see the opportunity.
  • 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 ocPortal 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:
#85911
Avatar

Community saint

I can now safely report the tallies did not update with the fix.

I found an easier way to force a less than a one-day expiry…

I tried setting the expiry time using a decimal but was prompted that I missed filling in those fields when I tried saving. It said I need to use a whole number between some large negative number and some large positive number, so I put in -1 and it moved at the next Cron cycle, which in my case is 15 minutes.  :thumbs:

Steve
Back to the top
 
Posted
Rating:
#86016
Avatar

Ah, sorry about that. I'd called the cache rebuild function without loading up its code. Fix attached (tested it this time)…

Attachment
» Download: catalogue_entry_timeouts.php (1.96 Kb, 79 downloads so far)


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
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 ocPortal whenever you see the opportunity.
  • 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 ocPortal 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:
#86020
Avatar

Community saint

Fixed!  :thumbs:

Thanks, Chris.

Steve
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: