Problem/Motivation
When trying to import menu_link_content entity via default content, getting below error:
InvalidArgumentException: Field uri is unknown. in core/lib/Drupal/Core/Entity/ContentEntityBase.php:509
After spending some time investigating the issue, found that Drupal\replication\Normalizer\LinkItemNormalizer breaks the structure of link field which is causing import issue.
Without replication module enabled, the menu links can be export/import without any issues.

Proposed resolution
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | replication-default_content_link_field_normalization-2966785-2-D8.patch | 661 bytes | andyf |
| replication-issue.png | 148.76 KB | vijaycs85 |
Comments
Comment #2
andyf commentedHi,
I'm seeing the same thing exporting a node with a link field using default_content and replication. I think I understand what's going on. From
\Drupal\hal\Normalizer\FieldItemNormalizer::normalize():Normally default_content relies on
Drupal\hal\Normalizer\FieldItemNormalizerwith a priority of 10 to handle links, but when replication's enabled, its\Drupal\replication\Normalizer\LinkItemNormalizertakes over with a priority of 40 and it doesn't return things in that particular format Hal is expecting. I'm brand new to replication, so could be missing something (: but is the solution just to prevent normalization of hal_json? (See attached patch.)Thanks!
Comment #3
andyf commentedComment #5
jeqq commentedAs Hal module does some special handling for that field type I think the fix makes sense.
Thanks @AndyF!
Comment #6
jeqq commented