[3.0] Restores the strings the backup checkbox explains itself with - #9648
Open
albertlast wants to merge 1 commit into
Open
[3.0] Restores the strings the backup checkbox explains itself with#9648albertlast wants to merge 1 commit into
albertlast wants to merge 1 commit into
Conversation
The help line under "Backup SMF tables" chooses between upgrade_backup_already_exists and upgrade_recommended, and neither has been defined since the maintenance strings were tidied. Lang::getTxt() answers a key it does not know with an empty string, so the admin gets an empty span either way. The first of the two is the only place the upgrader says that enabling the option replaces a backup that is already there, which is what backup_table() does to it. Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
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.
Description
The line of help text under the "Backup SMF tables" checkbox on the upgrader's options page is empty, whichever of its two states it is in.
UpgradeTemplate.phppicks one of two strings for it:Neither is defined.
ddb7919c1("Cleans up maintenance strings") removed both fromLanguages/en_US/Maintenance.phpand left the two call sites behind:Nothing reports it, because
Lang::getTxt()ends withA key that does not exist is an empty string, not a missing-string marker, so the page renders
<span class="smalltext"></span>and looks like a design choice rather than a fault.The second of the two is the one worth having back.
doBackupTable()callsDb::$db->backup_table(), which drops the destination table before writing it, so ticking that box when a backup is already there replaces it with a copy of the database as it stands now. That sentence is the only place the admin is told so.This restores both strings as they were.
How this was verified
First statically: every string literal that
UpgradeTemplate.phppasses as the first argument togetTxt(), checked against every$txt,$helptxt,$tztxt,$editortxtand$txtBirthdayEmailskey defined anywhere inLanguages/en_US/. Of the 65 language keys the template uses, these two are the only ones with no definition.Then on the page itself, against a 2.1.7 baseline upgraded to 3.0 so that a full set of
backup_tables exists, reading the rendered span on step 2:backup_recommended<span class="smalltext"></span>Backup already exists. If you enable this option, the existing backup will be replaced with a new one.<span class="smalltext"></span>Strongly recommended!Both branches were reached on a running forum rather than reasoned about: the first as the upgrade left it, the second by putting
smfVersionback to2.1.7sobackupRecommended()takes the other path, and restoring it afterwards.Not reachable from the unit suite
The strings are read by a template that renders a page, and
beStrictAboutOutputDuringTestsmeans the suite cannot run one.Issues References (Fixes|Related|Closes)