See #2577923: MenuLinkContent entities pointing to nodes are not deployable: LinkItem should have a "target_uuid" computed property
This is a patch for option 3 as a temporary workaround.
| Comment | File | Size | Author |
|---|---|---|---|
| #59 | interdiff-2670954-58-59.txt | 309 bytes | mrinalini9 |
| #59 | menu_link_uuid_nid-2670954-59.patch | 665 bytes | mrinalini9 |
| #58 | menu_link_uuid_nid-2670954-58.patch | 665 bytes | vbouchet |
| #52 | menu_link_uuid_nid-2670954-52.patch | 610 bytes | duaelfr |
| #52 | interdiff.2670954.51.52.txt | 325 bytes | duaelfr |
Comments
Comment #2
sanduhrsPatch attached.
Comment #3
ademarco commentedURI seems to be exported as "entity:node/12345": I'm re-rolling the patch to take that into account in MenuLinkNormalizer::getNidFromUri().
Comment #5
ademarco commentedRe-rolling making sure tests pass.
Comment #6
larowlanCan we make this entity-type agnostic. E.g. parse out the entity-type too, and inject the EntityTypeManager so we can use
$this->entityTypeManager->getStorage($entity_type)->load($entity_id)instead ofNode::loadAlso, instead of using
preg_match_all, we should useparse_url()like\Drupal\Core\Url::fromUridoes.Looking great though, nice work
Comment #7
jibla commentedComment #9
jibla commentedSorry, I had to upload .txt file.
Comment #10
jibla commentedComment #11
sanduhrs@jibla Please provide a patch file with the full set of changes and if applicable an interdiff with only the differences to the previous patch.
Comment #12
jibla commentedUploading full patch file.
/cc @sanduhrs
Comment #13
jibla commentedChanged method name, made it more clear and consistent with its purpose.
Comment #14
ademarco commentedLooking good! Marking as RTBC.
Comment #15
plopescNevermind
Comment #16
plopescWorking with this patch I had conflicts with Better Normalizers sandbox module, given that
MenuLinkNormalizerclass is not defining its specific$supportedInterfaceOrClassproperty.Attaching a new patch that forces
MenuLinkNormalizerto be used only forDrupal\menu_link_content\MenuLinkContentInterfaceobjects.Thanks
Comment #17
james.williamsWhen both my menu links and nodes are installed as default content from the same module, I hit this error:
This is because the menu links don't declare their dependencies on the nodes, so are created before the nodes, so the denormalization introduced in these patches fails.
Comment #18
andypostentity.manager is not needed (deprecated)
please remove
Better brifly describe what if does and for
Comment #19
Syndz commentedI experienced the same problem as described in #17.
I decided to experiment a bit, here's a bit of a different take on the problem.
Comment #21
Syndz commentedResolved a conflict with other normalizers with the same priority by stating a supported interface.
Comment #23
aaronbaumanAdding detail here per #2842533-2: Menu hierarchy not maintained after enabling menu link content
Latest patch doesn't fix the problem with menu hierarchy.Menu item parents are still not assigned correctly when enabling default menu link content.
Latest patch *does* fix the problem with menu hierarchy, but requires all menu_link_content to be re-exported in order to build the dependencies.
Comment #24
larowlanWe should just make default_content depend on Better Normalizers and move http://cgit.drupalcode.org/entity_pilot/tree/src/Normalizer/MenuLinkCont... into it, and use it in both Entity Pilot and Default content.
Comment #25
aaronbaumanMenuLinkContentNormalizer has a chain of dependencies on entity_pilot, starting with UnsavedUuidResolverInterface and including entity_pilot/Exists plugin.
How do you suggest that this be untangled?
Comment #26
larowlanAh right, because Entity Pilot needs to dereference unsaved entities so it can preview incoming content.
We don't need that, but we need the other part of that logic to handle parent references.
Comment #27
aaronbaumanOK, that makes this patch much simpler.
Postponing on #2845455: Menu Link Content normalizer and #2845456: Move MenuLinkContentNormalizer to better_normalizers, except for UnsavedUuidResolverInterface
Comment #28
aaronbaumanComment #29
aaronbauman#2845455 is resolved - MenuLinkNormalizer is in better_normalizers now, so both this issue and #2845456 can proceed to review
Comment #31
aaronbaumanresults from testbot:
uh... what?
this is a one-line patch to add a dependency.
is testbot broken?
Comment #32
aaronbaumanTIL about "test_dependencies"
If this patch passes tests, then #27 should be considered for inclusion.
Comment #34
aaronbaumanThis should not be so difficult
Comment #36
aaronbaumanOK, I give up.
I don't know how to add a dependency that will pass tests.
re-submitting #27
Comment #37
andypostcomposer.json also needs update
Comment #38
andypostlet's see what testbot will tell
Comment #39
andypostAdding a dependency on another module require test coverage
Comment #41
andypostReleased new beta to allow composer to find dependency https://www.drupal.org/project/better_normalizers/releases/8.x-1.0-beta2
Comment #43
andypostOne more round on composer dependencies
Comment #45
andypostTests for 8.2 core passed, also commited #2849133: Add rest dependency
Keeping NW for tests
Comment #46
vprocessor commentedpatch rerolled
Comment #47
andypostComment #49
evilehk commentedI wasn't able to get patch #46 to apply to the commit before "20 May 2017 at 12:15". I was able to apply patch #43 to the commit before "11 February 2017 at 05:05", and then rebased and resolved conflicts. Attached is a rerolled patch of 43 with an interdiff.
Comment #50
evilehk commentedMissed a commit. Take 2.
Comment #51
duaelfrRerolled on last dev version
Comment #52
duaelfrThis patch:
- removes an uneeded dependency on the rest module introduced by #49
- removes the test_dependency addition to the info file as the documentation indicates it's only useful if it is different from dependencies
Comment #53
duaelfrThis issue is super useful to deal with menus.
It'd be really cool if people that use these patches could jump in and say "hi" :)
Comment #54
vijaycs85+1 to have better_normalizers here.
Comment #55
vijaycs85Comment #56
vbouchetI tested it and it works very well.
Please find an updated version of DuaelFr's patch.
Comment #57
vbouchetOk, I just edited DualFr test without properly testing it and I missed to update the drupal/core version in composer.json. Also the info.yml does not contain the core attribute anymore, only core_version_requirement. Please find an updated patch.
It sill fails on my local due https://www.drupal.org/project/drupalorg/issues/3066468
Comment #58
vbouchetComment #59
mrinalini9 commentedFixed require failure issue in #58, please review.
Comment #60
vbouchetThanks mrinalini9. It works well.
Comment #61
berdirI've recently created the 2.0.x branch, see the project page on all the improvements in the 2.0.x branch. Testing that and providing feedback would be very welcome. The 1.x branch isn't actively maintained and won't receive new features anymore, so I'm closing this and other issues as won't fix.
2.0.x uses a completely different normalization implementation that does not depend on hal.module anymore and all the features of the better normalizers module are built-in.