[3.0] Theme split (wave 1, part 2) — List the maintenance tasks as one pick-one form - #9333
Merged
live627 merged 4 commits intoAug 2, 2026
Merged
Conversation
…e pick-one form The routine and database maintenance pages each hand-wrote one heading, one form and one submit button per task, which is why adding a task meant editing the template. Replace both with a single template_maintain_options() driven by Utils::$context['options'], built from the sub-action's own activity list so the two cannot drift apart. A task whose strings are not named maintain_<activity> supplies its own title and info. This also fixes the "Unable to load the '' template" error reported on SimpleMachines#7933: the sub-actions that have no 'template' key left Utils::$context['sub_template'] set to an empty string. Adds text_title and convert_to_suggest_text: offering to convert the messages body column back to TEXT needs a heading, and needs to warn when the maximum message length would no longer fit. Renames maintain_errors to maintain_repair to match its activity name; maintain_cache keeps its name because the admin home page uses it too. Wave 1, part 2 of breaking up SimpleMachines#7933. Co-Authored-By: John Rayes <live627@gmail.com> Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Closed
php-cs-fixer's ordered_class_elements and SMF/section_comments rules place protected methods there.
template_maintain_options() is looked up as 'maintain_options'; 'options' resolves to a template_options() that does not exist, so the routine and database tabs died with 'Unable to load the options sub-template'.
albertlast
force-pushed
the
3.0/theme-maintenance
branch
from
August 1, 2026 07:28
619ee26 to
bf646d6
Compare
Contributor
|
SimpleMachines#8787 removed that direction, and changeMsgBodyLength() returns without doing anything once the column is MEDIUMTEXT. Rebuilding the maintenance screen as a pick-one list brought the option back, so on a forum that had already converted, "Convert to TEXT" appeared and did nothing when run. Offer the conversion only while the column is still TEXT, and drop the two language strings SimpleMachines#8787 deleted along with it.
Collaborator
Author
|
should be better now |
live627
approved these changes
Aug 2, 2026
This was referenced Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wave 1, part 2 of breaking up #7933. Touches one theme template, and it is the one the change is about.
What changes
template_maintain_routine()andtemplate_maintain_database()each hand-wrote a heading, a form and a submit button for every task. Adding a maintenance task meant editing the template. Both are replaced by onetemplate_maintain_options():Utils::$context['options']is built from the sub-action's ownactivitieslist, so the form and the dispatcher cannot drift apart. A task whose strings are not namedmaintain_<activity>supplies its owntitleandinfo, andafterappends markup below the description. The shared wrapper and the "task finished" notice move into amaintaintemplate layer.Fixes the reported template error
@dragomano reported this on #7933:
routineanddatabaseare the two sub-actions with no'template'key, and the dispatcher didso they asked for a sub-template named
''. They now default tomaintain_options.Language strings
maintain_errors→maintain_repair, so it matches its activity name. Its only consumer was the template being replaced.maintain_cachekeeps its name —Admin.template.phpandcleanCache()also use it — socleancachesupplies its title and info explicitly. Same forconvertentities, sincetemplate_convert_entities()still uses theentity_convert_*strings.text_title. Converting the messages body column is offered in both directions now, and the TEXT direction had no heading.convert_to_suggest_text, shown when the maximum message length is at or above 65535, since shrinking the column would truncate posts members can currently make.Note on scope
#7933 also converts the board picker on the Topics tab to
<details>plus a sharedtemplate_choose_boards()helper. I left that out, for two reasons: the helper lives inGenericControls.template.php, which belongs to the editor part of the split, and it emitsname="brd[]"whileTopicRemove::old()reads$_POST['boards']as an associative array — so on that branch, pruning by selected boards would not do what the form says. That conversion should come with the part that owns the helper, with the field name sorted out.Testing
optimizeandconvertentitiesonly,convertmsgbodycorrectly absent.#manage_maintenanceappears exactly once.🤖 Generated with Claude Code