Hi,
I am implementing the metatags module (8.1.3) in my Drupal 8.3.7. I've a field metatags in all my content-type and they're working as expected except for the content-type 'article'. I am using REST webservices so when I receive my article JSON the metatag field is equal to NULL.
I was looking into the node and the metatag field is an instance of FieldItemList when the other ones the field is an instance of MetatagEntityFieldItemList. But when checking the field_metatags it include a FieldItemList which 1st element is an instance of FieldType\MetatagFieldItem.
I checked the code in the metatag.module line 422 and my node is passing the if.
// If the entity type doesn't have a base table, has no link template then there's no point in
// supporting it.
if (!empty($base_table) && $canonical_template_exists && !in_array($original_class, $classes_to_skip)) {
$fields['metatag'] = BaseFieldDefinition::create('map')
->setLabel(t('Metatags'))
->setDescription(t('The metatags for the entity.'))
->setClass('\Drupal\metatag\Plugin\Field\MetatagEntityFieldItemList')
->setQueryable(FALSE)
->setComputed(TRUE)
->setTargetEntityTypeId($entity_type->id());
}
I can't find more information about the cause, actually the first metatag field I created was on this content-type and reuse it in the other ones.
Thanks in advance.
Comments
Comment #2
otrolopezmasI found the problem was a field base override configuration.