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

Comments

maxocub created an issue. See original summary.

maxocub’s picture

Status: Active » Needs review
StatusFileSize
new995 bytes

Here'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.

heddn’s picture

We could do a unit test, no?

maxocub’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

Right, 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.

maxocub’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
StatusFileSize
new1.29 KB
new2.35 KB

Here's a failing test.

The last submitted patch, 5: 2979931-5-test-only.patch, failed testing. View results

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

masipila’s picture

Status: Needs review » Reviewed & tested by the community

I 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

  • There is a failing patch that demonstrates the problem as requested by @heddn in #3.
  • The patch #5 passes the tests with the new test included.
  • My manual testing is OK.
  • Patch looks good to me.
  • RTBC.
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

@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.

  • alexpott committed 5a0537e on 8.7.x
    Issue #2979931 by maxocub, masipila: Warnings in...

  • alexpott committed 0b66aaf on 8.6.x
    Issue #2979931 by maxocub, masipila: Warnings in...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.