Remove array_filter from FieldInstanceSettings

Created on 9 September 2019, about 5 years ago
Updated 28 February 2023, almost 2 years ago

Problem/Motivation

While migration field instances:

$ drush migrate-import upgrade_d7_field_instance
[warning] array_filter() expects parameter 1 to be array, null given FieldInstanceSettings.php:47
[notice] Processed 239 items (95 created, 0 updated, 0 failed, 144 ignored) - done with 'upgrade_d7_field_instance'

This happens because entity reference field instance could not has 'sort'-field at all.

Patch will be attach.

Steps to reproduce

Proposed resolution

Remove the use of array_filter from FieldInstanceSettings.

Remaining tasks

Add a test and a fail patch
Review

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Needs work

Version

10.1 ✨

Component
MigrationΒ  β†’

Last updated about 2 hours ago

Created by

πŸ‡·πŸ‡ΈSerbia super_romeo Belgrade

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • First commit to issue fork.
  • last update over 1 year ago
    29,388 pass
  • πŸ‡ΊπŸ‡ΈUnited States mlncn Minneapolis, MN, USA

    Received a very similar error, also running a migration, and the above commit fixes itβ€” but i fear it will not be accepted, at least not as part of this issue/patch, given that the fix is in a regular Views plugin not a migration plugin.

  • πŸ‡©πŸ‡ͺGermany u.kurilla

    I am working on a d7->d10 migration with 220 field_instance(s) to be migrated. It was frustrating and time consuming to get crashes of "drush mim" due to this array_filter issue (yes, crashes). I was not brave enough to suspect the core code to have a problem. It was only after i found this issue thread here that i simply removed the function call (patch #6) and all the problems disappeared! I am so happy, that you discussed this here.
    However, i think the patch should find a way into the core code for all the d7+ drupal versions.

Production build 0.71.5 2024