View Issue Details

IDProjectCategoryView StatusLast Update
0004584Composrcore_cnspublic2021-02-06 02:00
ReporterGuestAssigned To 
SeverityFeature-request 
Status non-assignedResolutionopen 
Product Version 
Fixed in Version 
Summary0004584: Script to delete old empty comment topics
DescriptionIf someone decides to disable the previously-enabled strong_forum_tie option, they will be left over with lots of empty comment topics.
Make a Commandr command to clean this up.
Steps To ReproduceBasic query would be like this.

set_option('is_on_strong_forum_tie', '0');
$db = $GLOBALS['FORUM_DB'];
$db->query('DELETE FROM ' . $db->get_table_prefix() . 'f_topics WHERE t_cache_num_posts=1 AND t_description LIKE \'Comment: %\'');
$db->query('DELETE FROM ' . $db->get_table_prefix() . 'f_posts p WHERE NOT EXISTS (SELECT * FROM cms_f_topics t WHERE t.id=p.p_topic_id)');
require_lang('cns');
require_code('tasks');
call_user_func_array__long_task(do_lang('CACHE_FORUMS'), null, 'cns_recache');

Should not assume 'Comment' though, needs to check language string.
Also should not assume multi-lang-content is disabled, there will be language strings to cleanup.
TagsNo tags attached.
Time estimation (hours)1
Sponsorship open

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2021-02-06 01:48 Guest New Issue
2021-02-06 01:51 Chris Graham Steps to Reproduce Updated View Revisions
2021-02-06 02:00 Chris Graham Steps to Reproduce Updated View Revisions