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:
- prune_all_forums - Prune all forums cron task.
- prune_forum - Prune one forum cron task.
- prune_shadow_topics - Prune one forum of its shadow topics cron task.
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.