Seeing error with metatags.
Drupal\Core\Entity\EntityStorageException: Field Metatags is unknown. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 770 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Drupal\Core\Entity\ContentEntityBase->get('Metatags') (Line: 660)
_content_sync_db_to_entity('node', 'landing_page', '5554') (Line: 215)
content_sync_entity_update(Object) (Line: 229)
content_sync_entity_insert(Object)
call_user_func_array('content_sync_entity_insert', Array) (Line: 402)
Drupal\Core\Extension\ModuleHandler->invokeAll('entity_insert', Array) (Line: 169)
Drupal\Core\Entity\EntityStorageBase->invokeHook('insert', Object) (Line: 441)
Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('insert', Object) (Line: 470)
Drupal\Core\Entity\EntityStorageBase->doPostSave(Object, ) (Line: 326)
Drupal\Core\Entity\ContentEntityStorageBase->doPostSave(Object, ) (Line: 395)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 761)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object) (Line: 364)
Comments
Comment #2
john.money commentedSpent some more time testing, disabling the metatags module (after first removing all metatag field instances) resolves this issue. Still need path forward for both modules to co-exist.
Comment #3
blanca.esqueda commentedHi @john.money
Version 8.x-1.x supports only the Drupal core fields (as mentioned on the project page description), that's the reason why you were getting that error.
---
But we have a new version 8.x-2.x, that it is able to handle custom fields (as paragraphs) so probably it can handle metatags.
Please feel free to pull version 8.x-2.x and do some testing and if possible let us know the results.
Be aware that the yaml files are different from one version to the other as some changes were needed to implement new functionality (that means the same version has to run on the source and target sites).
Note that version 8.x-2.x is a beta, so be careful to create backups before importing.
Comment #4
blanca.esqueda commentedI did some testing with Drupal 8.4, content_sync 8.x-2.x , and metatag 8.x-1.3
Unfortunately there is a conflict.
errors:
Drupal\Core\Entity\EntityStorageException: Object support when dumping a YAML file has been disabled. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save()
Drupal\Component\Serialization\Exception\InvalidDataTypeException: Object support when dumping a YAML file has been disabled. in Drupal\Component\Serialization\YamlSymfony::encode()
Comment #5
socialnicheguru commentedJust ran into the errors outlined in #4
Comment #6
janlaureys commentedI was testing this module as well because it seems like a perfect fit for our use case, but ran into this issue as well.
Apparently because it's using the YamlSymfony class to encode data to yaml and the dump function gets a SymfonyYaml::DUMP_EXCEPTION_ON_INVALID_TYPE parameter rather than a SymfonyYaml::DUMP_OBJECT and the metatags field looks like this:
[field_metatags] => Array ( [0] => Drupal\Core\StringTranslation\TranslatableMarkup Object ( [string:protected] => Metatags are normalized in the metatag field. [translatedMarkup:protected] => [options:protected] => Array ( ) [stringTranslation:protected] => [arguments:protected] => Array ( ) ) )
Comment #7
amenzou commentedIt's not an issue with content_sync. Metatag didn't implement their FieldItemNormalizer correctly. The normalize() function should return an instance of the $supportedInterfaceOrClass which is Drupal\metatag\Plugin\Field\FieldType\MetatagFieldItem, but instead a Translation object is returned;

---
Instead of just saying normalization is not supported, they should've implemented the method made for that exact purpose;
Comment #8
webfaqtory commentedI can confirm that making the following changes to metatag/src/Normalizer/FieldItemNormalizer.php solves the problems with #4
Comment #9
blanca.esqueda commentedamenzou and webfaqtory,
Added your notes on the following Metatag issue:
https://www.drupal.org/project/metatag/issues/2903457#comment-12660595
Thank you so much!