Problem/Motivation

When running drush cex the following error occurs:
TypeError: Argument 1 passed to NestedArray::unsetValue() must be of the type array, null given

In #3117135 we fixed a bug related to the code but we didn't fix the fact that Drupal\Core\Config\DatabaseStorage::read can return FALSE which causes this fatal error to occur.

In order to reproduce you need a partial config ignore (e.g. block.block.myblock:settings.label) but no config translation for it.

Proposed resolution

Don't write the config to /sync when it doesn't exist in the database.

Comments

mpp created an issue. See original summary.

mpp’s picture

Status: Active » Needs review
StatusFileSize
new1.07 KB
daniel kulbe’s picture

Confirming the patch works as expected.

joco_sp’s picture

We had the same problem, but got this error:

TypeError: Argument 1 passed to Drupal\Component\Utility\NestedArray::unsetValue() must be of the type array,<strong> bool given</strong>, called in /contrib/config_ignore/src/EventSubscriber/ConfigIgnoreEventSubscriber.php on line 150 in Drupal\Component\Utility\NestedArray::unsetValue() (line 219 of core/lib/Drupal/Component/Utility/NestedArray.php).

The patch above worked for us. The problem in our case were the lines:

system.site:name
system.site:mail
system.site:slogan
system.site:page
aurora.luzzardi’s picture

StatusFileSize
new1.67 KB
new2.47 KB

Hi,
I had almose the same issue but a few lines above, so I created an interdiff patch and a full patch with both changes.
Please check if makes sense.

The last submitted patch, 5: 3117809_3-interdiff.diff, failed testing. View results

Status: Needs review » Needs work

The last submitted patch, 5: 3117809_3.patch, failed testing. View results

aurora.luzzardi’s picture

Please, ignore my 2 patchs,I had other patch applied during the development, I will send new ones later.

bircher’s picture

I think this may be solved with #3117694-17: Make all available tests pass The bug is also #3186392-2: Port IgnoreKernelTest from 2.x to 3.x fail.

So I would close this as a duplicate when we commit the other one.

bircher’s picture

Status: Needs work » Closed (outdated)