About a week after updating to 7.x.3.4 I noticed that my daily backups were overwriting the previous day's files, because the backup files had no timestamps.
On checking the settings I found the file-save option was "overwrite" instead of "append timestamp", which is what it was previously. Changing it back to "append timestamp" restored my previous functionality, but I was alarmed that there had been a silent change.
I've looked at the recent commits, and Commit b05a282 added the option to overwrite. The problem is that the enumeration of the options has been changed. Rather than overwrite being added as enum 2, it's been inserted as enum 1, moving timestamp to enum 2. This means all existing settings that stored the value 1 have changed their meaning.
It's too late to revert this, as the damage has been done, and doing so would cause even more confusion. So I'm posting this mainly as a warning that if you have been using time-stamped backups, please check your settings as you may well be inadvertently overwriting the same file rather than preserving a history.
I don't know if there's any way to get this message out to users who don't follow the issues list. The impacts could be quite widespread.
Comment | File | Size | Author |
---|---|---|---|
#12 | backup_migrate-n2941981-12.interdiff.txt | 772 bytes | DamienMcKenna |
#12 | backup_migrate-n2941981-12.patch | 2.79 KB | DamienMcKenna |
|
Comments
Comment #2
DamienMcKennaOh no! Dangit :-(
Yeah, we need to fix this immediately and roll a new release.
Comment #3
DamienMcKennaDoes this solve the problem?
Comment #4
DamienMcKennaComment #5
RickJ CreditAttribution: RickJ commentedLooks OK, good idea with the message on update.
However, I would keep the order of the options in the UI as they were, with timestamp as the last. This is because it expands to show the timestamp format, and it looks better if that doesn't come in the middle of the checkboxes. It doesn't matter that the enum order in the code is 0, 2, 1.
I've tweaked the patch.
Comment #6
DamienMcKenna@Ric: Could you please upload an interdiff?
Comment #7
RickJ CreditAttribution: RickJ commentedSorry! here it is
Comment #8
camhowardThanks for working on this!
Can the spelling of "seperate" be corrected to "separate" in the list of options where it says:
0 => t('Create seperate backups even if `Backup file name` is the same.'),
A minor issue, but perhaps easier done now than later.
Comment #9
DamienMcKennaSome some general wording improvements.
Comment #10
RickJ CreditAttribution: RickJ commentedOne last fix needed. The timestamp box in the UI was expanding on the overwrite checkbox, I've updated the patch.
Comment #11
camhowardI've now had time to apply the patch and test.
Here's how I tested:
Questions and observations:
Should the "Leave a message to explain the mixup over the backup option" display as a string $type 'warning' rather than the default 'status' in order to call more attention to it? The message itself is helpful. Since this is a critical issue, I wonder if a 'warning' message would alert people that it requires action on their part.
The backup schedule is creating backups with an appended timestamp as expected.
Thanks.
Comment #12
DamienMcKenna@camhoward: That's a good idea, thanks.
Comment #14
DamienMcKennaCommitted. Thanks for all of your help today.
Comment #15
DamienMcKennaFYI I released 3.5 today with this fix. Thank you again!
Comment #16
camhoward@DamienMcKenna and @Rick J: Thanks for the quick fix on this!
Comment #17
jackalope CreditAttribution: jackalope commentedI'm afraid that the fix included in the 7.x-3.5 release isn't working properly!
I was able to successfully change the "Save mode" setting to "Append the timestamp" again, save my change and see my changes preserved upon an additional edit; the change seems to have stuck properly, so it seems like this is a problem with the 7.x-3.5 update rather than an issue with the module not saving settings properly at all.
I've double-checked and have seen the same results on four different Drupal sites so far after the 7.x-3.5 update.
This seems especially concerning given the message included in this update that reassures users that this very bug has been fixed!
Comment #18
DamienMcKennaDangit, I'm sorry :-(
I'll see if I can use some time at FLDrupalcamp to work on test coverage.
Comment #19
camhowardI believe the issue @jackalope raises is related to the enumeration of the options as @Rick J noted in his original post when he says:
The options in 7.x.3.4 are:
7.x.3.5 changed the enumeration to:
So 7.x.3.5 changes the meaning of value 1 again, back to 'Append the timestamp' as in versions prior to 7.x.3.4. This helps the people who updated to 7.x.3.4 and didn't check or change their settings and didn't know backups were being overwritten.
It also means people who updated to 7.x.3.4, checked their settings and changed them will need to check their settings and change them again when they update to 7.x.3.5.
I understood the emphasis of the message that displays after the update to 7.x.3.5 to be check your settings.
Comment #20
RickJ CreditAttribution: RickJ commentedThat's correct, 7.x.3.5 restores the behaviour of 7.x.3.3, but with one extra option. 7.x.3.4 was a slight aberration. On the basis that most people who upgraded to .4 won't have checked their settings, a subsequent upgrade to .5 ensures their settings work as before.
Comment #21
DamienMcKennaFYI I've started writing tests in #2937023: Add a test for the basic UI functionality (D7), once that's committed I'll work on this part.
Comment #22
DamienMcKennaComment #23
DamienMcKennaI'm moving the tests into their own issue: #2945704: Write tests for each backup filename option