PHPBB3-15096 Auto prune of shadow topics doesn't happen if using system cron

Discuss requests for comments/changes posted in the Issue Tracker for the development of phpBB. Current releases are 3.2/Rhea and 3.3/Proteus.
Post Reply
User avatar
P_I
Community Team
Community Team
Posts: 137
Joined: Fri Oct 31, 2014 4:56 am

PHPBB3-15096 Auto prune of shadow topics doesn't happen if using system cron

Post by P_I »

Ticket: https://tracker.phpbb.com/browse/PHPBB3-15096

Problem:
There are two parts to the ACP->Manage forums->Forum prune settings. Consider the case where a board has forum(s) configured (ACP->Manage forums) with Enable auto-pruning of shadow topics: to Yes. This is similar to another Forum prune setting of Enable auto-pruning.

If ACP->Server settings Run periodic tasks from system cron: is set to No, then Shadow topics get auto-pruned according to the forum configuration settings as do the 'normal' topics. However, if ACP->Server settings Run periodic tasks from system cron: is set to Yes, then Shadow topics never get auto-pruned but the 'normal' topics do get auto-pruned.

Investigation:
As mentioned in the ticket, I've done further digging and in phpbb/cron/task/core there is: Solution?
To solve the ticket shouldn't there be a prune_all_shadow_forums that mimics prune_all_forums? An alternative would be to overload prune_all_forums to handle both the 'normal' topics and the shadow topics.

Next steps:
I've done a quick hack of the second approach as a proof of concept, which involves adding code to prune_all_forums and moving the auto_prune_shadow_topics() declaration from prune_shadow_topics to includes/functions_admin.php which is where auto_prune() is declared.

Unfortunately, changing and moving this amount of phpBB code around is above my comfort level, so I was wondering in another experience phpBB coder could take a look at this ticket and help either a) fix the ticket or b) guide me to learn how to fix the ticket within the phpBB coding guidelines.

Thanks in advance.

Post Reply