Problem/Motivation
Recently, I had a need to export media entity and discovered that modules supports only node
and block_content
entity types for now. It was pretty easy to add a custom route and operation to the custom module, but why don't we support more entity types out-of-the-box?
Proposed resolution
Make all content entity types exportable. We can do it by providing dynamic routes and using link templates.
Remaining tasks
1. Review and decide if it makes sense;
2. Test it carefully. Automated tests will be great too. Should be moved to #3229471: Cover functionality with basic unit tests
3. Make local tabs dynamic - they're still in single_content_sync.links.task.yml
file;
4. At the same time, we should probably introduce a more granular access system. Currently, one permission gives access to everything;
Issue fork single_content_sync-3279202
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
MatroskeenMoving back to NR just to bring some attention from the maintainer. If it's all good, we can move on to the remaining items.
Comment #4
MatroskeenComment #5
nginex CreditAttribution: nginex as a volunteer and commentedThis is definitely a great idea, going to review that
Comment #6
nginex CreditAttribution: nginex as a volunteer and commentedHi Matroskeen,
I've added support for dynamic local tasks.
Remaining tasks:
Automated tests can be added here #3229471: Cover functionality with basic unit tests
Comment #7
nginex CreditAttribution: nginex as a volunteer and commentedComment #8
MatroskeenGood job! I won't have time in the nearest few weeks, so feel free to tackle remaining items. I'll be happy to test and review though :)
Comment #9
nginex CreditAttribution: nginex as a volunteer and commentedGot it! No problems
Comment #10
MatroskeenWe should probably consider the following. If we release this change, then users also will be exportable and it might expose some sensitive information (even if the affected role is only "Administrator"). Users is just one example, but there might be more entity types, that should not be exportable at all.
I wonder if we should make a config page when entity types are being enabled/disabled for exporting. We could enable this option by default for previously supported entity types:
node
andblock_content
to keep existing behavior. I think "Content Translation" module works in a similar way.Comment #11
artycal CreditAttribution: artycal at Dropsolid commentedComment #12
artycal CreditAttribution: artycal at Dropsolid commentedComment #13
artycal CreditAttribution: artycal at Dropsolid commentedUpdated issue summary, moving to Needs Review
Comment #14
artycal CreditAttribution: artycal at Dropsolid commentedMove to Needs work
Need to add a config form to limit the export of content types
Comment #15
artycal CreditAttribution: artycal at Dropsolid commentedComment #17
nginex CreditAttribution: nginex as a volunteer and commentedThanks guys for this great update, it will be released soon
Comment #18
nginex CreditAttribution: nginex as a volunteer and commentedAvailable in 1.3.4