When I attempted to create multiple schedules (daily, weekly, monthly) with multiple destinations (/daily, /weekly, /monthly) using the same profile, all the backups were saved into the /daily folder.
After doing a little digging I found the suspect code:
FILE: includes/profiles.inc
/**
* Get the destination of the profile.
*/
function get_destination() {
backup_migrate_include('destinations');
if (empty($this->destination) && !empty($this->destination_id)) {
$this->destination = backup_migrate_get_destination($this->destination_id);
}
return empty($this->destination) ? NULL : $this->destination;
}
This code ignores the 'destination' re-assignment' if '$this->destination' is NOT empty, which is what happens when this function gets called on the subsequent destinations.
The following code fixes this:
/**
* Get the destination of the profile.
*/
function get_destination() {
backup_migrate_include('destinations');
if ((empty($this->destination) && !empty($this->destination_id)) ||
(!empty($this->destination) && !empty($this->destination_id) &&
($this->destination->destination_id != $this->destination_id))) {
$this->destination = backup_migrate_get_destination($this->destination_id);
}
return empty($this->destination) ? NULL : $this->destination;
}
I have included a patch as well.
| Comment | File | Size | Author |
|---|---|---|---|
| profiles-inc.patch | 724 bytes | varr |
Comments
Comment #1
dgorton commentedComment #2
ronan commentedI think this has been fixed by a separate patch. Please reopen if the latest dev still has this issue. Thanks!
Comment #4
danielphenry commentedI'm encountering this issue on version 7.x-3.1 I haven't confirmed it's caused by using the same profile but I am using the same profile with 3 destination and only the first destination I created is getting 3 copies of every backup. Is their a more recent version of this issue?
Comment #5
couturier commentedI'm unaware of another similar issue for 7.x, so I am moving this issue to the 7.x-3.x-dev branch based on Comment #4. Drupal core and Backup and Migrate 6.x is no longer supported.
Comment #6
damienmckennaUnable to reproduce this.