Cannot get value of Node object I'm trying to retrieve a value from a Node object. It looks like the value is there, when debugging and checking out the object. But somehow it cannot be accessed.

Trying to get the field:

// $this-&gt;entityManager is an instance of EntityTypeManagerInterface 
$node = $this-&gt;entityManager-&gt;getStorage('node')-&gt;load($nodeId);

// hasField always returns FALSE
$node-&gt;hasField('field_google_hire_identifier');
// $node-&gt;get('field_google_hire_identifier'); returns unknown field error


Debugging $node->hasField, looking inside getFieldDefinition:

  public function getFieldDefinition($name) {
    if (!isset($this-&gt;fieldDefinitions)) {
      $this-&gt;getFieldDefinitions();
    }
    if (isset($this-&gt;fieldDefinitions[$name])) {
      // This code should be executed, but it is not.
      return $this-&gt;fieldDefinitions[$name];
    }
  }




The second if statement content is not executed, with my understanding it should be.

The node was created with migrate.

I disabled APC and Opcache.
The field name string contained a right to left mark.
See https://stackoverflow.com/questions/54653637/cannot-get-array-key-array-key-not-set/54655517#54655517 to find out how to remove it