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;

Command icon 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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Matroskeen created an issue. See original summary.

Matroskeen’s picture

Status: Active » Needs work

Moving back to NR just to bring some attention from the maintainer. If it's all good, we can move on to the remaining items.

Matroskeen’s picture

Status: Needs work » Needs review
nginex’s picture

Assigned: Unassigned » nginex

This is definitely a great idea, going to review that

nginex’s picture

Assigned: nginex » Unassigned
Status: Needs review » Active

Hi Matroskeen,

I've added support for dynamic local tasks.

Remaining tasks:

  • Improve hook_help (it should also support dynamic content export routes)
  • Improve access for new dynamic routes

Automated tests can be added here #3229471: Cover functionality with basic unit tests

nginex’s picture

Status: Active » Needs work
Matroskeen’s picture

Good 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 :)

nginex’s picture

Assigned: Unassigned » nginex

Got it! No problems

Matroskeen’s picture

We 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 and block_content to keep existing behavior. I think "Content Translation" module works in a similar way.

artycal’s picture

Assigned: nginex » artycal
Status: Needs work » Active
artycal’s picture

Issue summary: View changes
artycal’s picture

Assigned: artycal » Unassigned
Issue summary: View changes
Status: Active » Needs review

Updated issue summary, moving to Needs Review

artycal’s picture

Assigned: Unassigned » artycal
Status: Needs review » Needs work

Move to Needs work
Need to add a config form to limit the export of content types

artycal’s picture

Assigned: artycal » Unassigned
Status: Needs work » Needs review

  • nginex committed 0539b44 on 1.3.x authored by Matroskeen
    Issue #3279202: Improve the subscriber a bit.
    
  • nginex committed 11983b0 on 1.3.x authored by artycal
    Issue #3279202 Add configuration form for allowed Entities
    
  • nginex committed 37b6e9c on 1.3.x
    Issue #3279202: Improve config form.
    
  • nginex committed 3d16526 on 1.3.x
    Issue #3279202: Add support of the dynamic local task for content...
  • nginex committed 955fe79 on 1.3.x authored by artycal
    Issue #3279202 Improve hook_help() in order to support dynamic content...
  • nginex committed a3c0581 on 1.3.x authored by Matroskeen
    Issue #3279202: A bit more consistency.
    
  • nginex committed cb30b5e on 1.3.x
    Issue #3279202 Refactor hook_help().
    
  • nginex committed faeff77 on 1.3.x authored by artycal
    Issue #3279202 Added granular access system for exporting content
    
  • nginex committed fd74c90 on 1.3.x authored by Matroskeen
    Issue #3279202: Support other content entity types.
    
nginex’s picture

Status: Needs review » Fixed

Thanks guys for this great update, it will be released soon

nginex’s picture

Status: Fixed » Closed (fixed)

Available in 1.3.4