Problem/Motivation
We are getting this assertion error when saving a node with an overridden locale:
AssertionError:
assert(is_string($field))
at core/lib/Drupal/Core/Database/Query/Merge.php:330
at assert(false, 'assert(is_string($field))')
(core/lib/Drupal/Core/Database/Query/Merge.php:330)
at Drupal\Core\Database\Query\Merge->key(array('nid' => '388'))
(modules/contrib/html_lang_override/src/HtmlLangManager.php:137)
at Drupal\html_lang_override\HtmlLangManager->saveLangForNode('388', 'gezg')
(modules/contrib/html_lang_override/html_lang_override.module:59)
at html_lang_override_entity_presave(object(Node))
Steps to reproduce
Edit a node and fill the "Custom HTML Lang Attribute" field.
Proposed resolution
I think key() should be called like this:
->key('nid', $nid)
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #3
prudloff commentedComment #4
rakesh.regar@prudloff Thanks for the contribution!