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

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

prudloff created an issue. See original summary.

prudloff’s picture

Status: Active » Needs review
rakesh.regar’s picture

Status: Needs review » Fixed

@prudloff Thanks for the contribution!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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