Problem/Motivation
When exporting menu_link_content entities and child menu_link_content is exported with dependencies, it doesn't export parent menu_link_content entity attached to it.
Steps to reproduce
- Create a parent menu link content entity in menu "main".
- Create a child menu link content entity with the parent reference.
- Run export command to export child menu link content entity. Ex:
$ php core/scripts/drupal content:export menu_link_content <child_menu_link_content_id> --with-dependencies --dir=public://content - The parent menu link content should be exported as well.
Proposed resolution
Create a DefaultContentEventSubscriber in menu_link_content module.
Issue fork drupal-3562072
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
vishalkhode commentedComment #4
phenaproximaI think this is a great find, and a great fix with very strong test coverage. There are a few things I think we should do differently, but they are implementation details. Solid stuff!
Comment #6
phenaproximaAddressed my feedback and converted the test to a kernel test, which is quite a bit easier to introspect.
Comment #7
phenaproximaTest-only job failed as expected: https://git.drupalcode.org/issue/drupal-3562072/-/jobs/8577213#L63
Comment #8
godotislateA couple of nit-ish comments on the MR, but I'm OK for RTBC.
Comment #9
phenaproximaThanks, @godotislate! Accepted your suggestion on the MR.
Comment #10
godotislateOK, lgtm
Test only failure: https://git.drupalcode.org/issue/drupal-3562072/-/jobs/8577906
Comment #12
godotislateThere've been changes since it was moved into RTBC, so just in case, I've looked again and it's still good.
Comment #13
alexpottCommitted and pushed 54bc9308376 to main and e065ffa1d4a to 11.x and c9562cad300 to 11.3.x. Thanks!