Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
When you upgrade a Drupal 7 site (with Entity Translation enabled) with drush, you get these warnings:
array_filter() expects parameter 1 to be array, null given EntityTranslationSettings.php:68
array_keys() expects parameter 1 to be array, null given EntityTranslationSettings.php:68
Proposed resolution
Make sure we don't pass null into array_filter() & array_keys().
Remaining tasks
- Write the patch
- Review
- Commit
User interface changes
None
API changes
None
Data model changes
None
Comment | File | Size | Author |
---|---|---|---|
#5 | 2979931-5.patch | 2.35 KB | maxocub |
#5 | 2979931-5-test-only.patch | 1.29 KB | maxocub |
Comments
Comment #2
maxocub CreditAttribution: maxocub commentedHere's the fix. I don't know how we could add a test for that since it's only showing up when you upgrade with drush and not with the UI.
Comment #3
heddnWe could do a unit test, no?
Comment #4
maxocub CreditAttribution: maxocub commentedRight, I'll try a Unit test. We have a Kernel test with a scenario where this warning should appear, but it doesn't. I'll see if I can reproduce it in a test.
Comment #5
maxocub CreditAttribution: maxocub as a volunteer commentedHere's a failing test.
Comment #8
masipila CreditAttribution: masipila as a volunteer commentedI tested this manually and reviewed the patch.
Test results without the patch #5
I was able to reproduce the warnings described in the issue summary.
Test results with patch #5 applied
No warnings are displayed.
Vocabulary entity translation settings are still migrated correctly with this patch applied.
Conclusion
Comment #9
alexpott@masipila thanks for the rtbc comment with great test evidence.
Committed and pushed 5a0537e6c8 to 8.7.x and 0b66aafc88 to 8.6.x. Thanks!
Backported to 8.6.x as a non disruptive bug fix that makes migrating Drupal better.