backdrop-contrib / backup_migrate

Port of the Drupal backup_migrate module to Backdrop
GNU General Public License v2.0
7 stars 14 forks source link

Prevent users from choosing the wrong restore destination for types #93

Open indigoxela opened 1 year ago

indigoxela commented 1 year ago

This popped up, when testing for #91.

Background: in D the module doesn't handle config backups, in B it does. That means, we have an additional destination for restores: "Configuration Files Directory".

On/admin/config/system/backup_migrate/backups, there's a link to "restore" a previously backed up config. Clicking on that link, opens the restore form, but the preselected value for "Restore to" is "Default Database". Nothing (really) bad happens, wenn submitting the form without switching that select list value, as I get the error:

Unable to restore from file /tmp/backup_migrate_Ud9H6O.tar because a tar file can't be restored to this database.

Not ideal, but nothing weird happens, either.

But I'm able to restore the config to "Public files directory" - and that is a problem, as these json files aren't supposed to be accessible by the public. Nothing warns me, and the json files get "published".

I ran into this by accident, and I think, this module should at least warn, better prevent that mistake.