Closed (fixed)
Project:
Backup and Migrate
Version:
8.x-4.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Mar 2019 at 10:27 UTC
Updated:
22 Jun 2021 at 19:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
TD44 commentedAfter updating from 8.x-4.0 to 8.x-4.1 i see :
(only with advanced backup)
@Pasqualle, how did you fix it?
Comment #3
Kabinfo commented+1 for update for > 8.x-4.0 php.7.1
Comment #4
saweyer commentedafter backup using 4.1 version, if I click on Settings, I see ERROR:
Warning: Invalid argument supplied for foreach() in BackupMigrate\Core\Plugin\PluginBase->configErrors() (line 125 of modules/backup_migrate/lib/backup_migrate_core/src/Config/ConfigurableTrait.php).
it did download a .gzip file, but with the error, I'm not completely confident that the backup succeeded.
also, I'm seeing a WARNING:
Please install the Defuse PHP-encryption library via Composer to be able to encrypt backup files.
if I'm not going to encrypt backups, should I have to install this??
(no errors in B-and-M 4.0 version)
Steve
Comment #5
damienmckenna@saweyer: Please open a new issue for that, it should do an 'information' message instead of a 'warning'.
Comment #6
godwing commentedIs there a solution to this issue?
This warning occurs if you are using Advanced Backup:
Warning: Invalid argument supplied for foreach() in BackupMigrate\Core\Plugin\PluginBase->configErrors() (line 125 of /.../.../mysite.com/modules/backup_migrate/lib/backup_migrate_core/src/Config/ConfigurableTrait.php)
Comment #7
localnetwork commentedHaving the same issue with @godwing when using advanced backup. Anyone here found a solution?
Comment #8
hoporr commentedSame issue: advanced backup throws this error. (fresh install: Core 8.9.6, PHP 7.2 )
I reverted to version 4.0, and it works fine again.
Comment #9
tonytheferg commentedSame here backing up from
admin/config/development/backup_migrate/advanced.Notice: Undefined index: fields in BackupMigrate\Core\Plugin\PluginBase->configErrors() (line 125 of MY-SITE\web\modules\contrib\backup_migrate\lib\backup_migrate_core\src\Config\ConfigurableTrait.php)Warning: Invalid argument supplied for foreach() in BackupMigrate\Core\Plugin\PluginBase->configErrors() (line 125 of MY-SITE\web\modules\contrib\backup_migrate\lib\backup_migrate_core\src\Config\ConfigurableTrait.php)Fresh install of 8.9.7 on php 7.3.15
Comment #10
couloir007 commentedI've been seeing it for a long time. Uninstalling and reinstalling has not solved it.
Undefined index: fields in BackupMigrate\Core\Plugin\PluginBase->configErrors() (line 125 of modules/contrib/backup_migrate/lib/backup_migrate_core/src/Config/ConfigurableTrait.php).
Comment #11
tonytheferg commentedPutting lines 125-151 under a check to make sure the
$schemais not empty removes the warning.if(!empty($schema)){I am just tinkering around with a wild guess, and have no idea what trouble this might cause, so I didn't create a patch for this.
Maybe it will be a helpful clue for the right fix.
Comment #12
damienmckennaThat's really weird :-\ The question is - why is $schema empty?
Comment #13
tonytheferg commentedRight, I wondered that too, but I don't really know what is going on under the hood. If you think it's safe to add that check for now, I can post a patch... LMK
Comment #14
tonytheferg commentedMaybe because of this:
So maybe it's trying to check an empty array?
Or does
* - 'backup': Configuration needed during a backup operationinclude advanced backups? That is where the notice and warning are being fired.Comment #15
tonytheferg commentedOk, so if someone wants to test this patch locally, that would be helpful.
All it does, is put lines 125-151 under a check to make sure the
$schemais not emptyif(!empty($schema)){before running the
configErrorschecks.Doing this removes both the notice and the warning.
This seems like a harmless enough check, but please don't apply this patch to a production environment until the maintainer reviews and says it's ok.
Comment #16
tonytheferg commentedComment #17
larisse commentedThe patch #15 remove the following notice and warning after doing an advanced db backup.
Comment #18
damienmckennaThank you for the patch and the review. Could someone please clean up the patch to make the Drupal coding standards? Thank you.
Comment #19
hmendes commentedHi @DamienMcKenna,
The Drupal coding standards that you are saying would be to get the phpcs errors fixed for the entire ConfigurableTrait.php file?
Comment #20
damienmckennaI'm mainly concerned about the two new lines added for the if() statement.
Comment #21
tonytheferg commented@damien, sure. All I saw was that
if(!empty($schema)){was missing a space before the{if(!empty($schema)) {Anything else?
Comment #22
tonytheferg commentedComment #23
hmendes commentedAccordingly to phpcs, there should be spaces after 'if', '\\' and ')'. phpcs_error.png
Adding a new patch.
Comment #25
damienmckennaThank you hmendes, that's exactly what I was thinking of.
Committed. Thank you all for collaborating on this.
Comment #26
tonytheferg commentedah, thanks!