Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
We have now config entity which store export configuration. Let's use them in the export form.
Remaining tasks
Allow to use the config entities instead of custom user configuration in the main export form.
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#15 | 3166121-allow-to-use-entity-export-csv-config.patch | 12.56 KB | jviitamaki |
#13 | EntityExportCsv-Config2.jpg | 84.89 KB | bkudrle |
Comments
Comment #4
aiphesSuscribe to this feature because I don't understand what is the point. Drush usage ?
Because I need to set again Machine name instead of label every time I do an export... :( I thought config could avoid this .
Comment #5
flocondetoileYou can save your settings when exporting per entity type / bundle. And soo next time you want to export same bunde, your user's settings are used.
This issue is to use config entities which have an export configuration on the export form yes. And be used also via drush if needed.
Any patch is welcome.
Comment #6
aiphesUnderstood. Actually when I save a setting when I redo an export some fields doesn't keep the previous settings. But part of the job is done :)
I'm not PHP dev so I can't help on patch ;)
Comment #7
flocondetoileThis shouldn't occur. Please fill an issue, with reproductible steps, for these export configuration field which are not saved, and reused on the next export.
Comment #8
Fool2 CreditAttribution: Fool2 at Spry Digital, LLC commentedI think the solution here is a "revert to default" button maybe on each entity type. And maybe a drush command to wipe the settings for all users and revert to default, deferring to config if one exists.
If there is a config entity for that export, it will revert to that config. Right now, that config is never used, it seems, even on a fresh install of the module.
In the form logic there is a TODO in comments
It seems like there should be a $config_default instead of [] where it gets the data from config. But the UX is not clear, which is why I would suggest having a "revert" or "reset" button that essentially deletes the $user_default_values that is stored per-user.
Comment #9
flocondetoileThe goal of this issue is to kept current behavior, the manual export (saved per user if checked), and expose configuration export (if they exists for the entity type / bundle). This could be a select list with an entry "manual export" which expose all the field configurations, and others entries for each configuration export (and if selected which hide all the field configurations).
Currently we can only use configuration export via custom code. Or width a drush command (see #3110170: Provide a drush command).
Comment #10
Fool2 CreditAttribution: Fool2 at Spry Digital, LLC commentedThat makes sense. But I think there are two use cases we can add to this situation and take advantage of the config.
The use case I am thinking is if you are delivering a website with export functionality to the client, you may want to set up some settings for them in config instead of them having to figure out all the formatting options. The same for any new user to the system.
Comment #11
flocondetoileSo we could have :
Default values based on an export configuration, if no user configuration found. The question is about if there is multiple export configurations for the same entity type / bundle. Does this need to be configurable ?
This shows some possible uses cases where we don't want a user have access to the whole export form, because "too complex". May be some permissions could answer to these use case. The basic permission could be about "access manual export" and "access configured export".
Comment #12
Fool2 CreditAttribution: Fool2 at Spry Digital, LLC commentedWhat would also help is an API documented or in-UI block/widget creator that we can say "Here is a button to generate this export, according to this config set"
The alternative to this module is using views and views_data_export spending lots of dev time wiring up all the fields and formats and permissions for every single entity. I think that is overkill for many usecases, which this module can more directly address. For instance, a site owner wants to export structured but human-readable data into another software to do data analysis.
Comment #13
bkudrle CreditAttribution: bkudrle as a volunteer and for National Science Foundation commentedI made a crude mockup according to my idea of what this issue is looking for. It is shown below.
I added the 'Use Saved Configuration' drop down. This assumes that the 'Basic Page Configuration Setting 1' and 'Basic Page Configuration Setting 2' are configurations that the user has saved for a Basic Page on the Entity export csv configuration entities page (/admin/config/content/entity-export-csv/configurations). After the selection is made from this drop down, then the values for all of the fields will be populated according to the item that was chosen.
I left None as the default choice, which I am assuming would enable all of the fields as a default. Or, perhaps per the discussion so far, we might want to have None display the default from what the user has already saved. Or perhaps we want to have another choice of 'Default' for using what the user saved from their previous usage. That would seem to be another aspect open for discussion.
Am I on the right track here? Is this along the lines of what you had envisioned for this issue? Are there things that should be changed?
Looking forward to feedback about this.
Comment #14
Defcon0 CreditAttribution: Defcon0 commentedI just installed the module and it's quite great. Only thing bothering me is that export config is stored per user and not in yml config. This is not practicable in a multi user setup. A default config on a node type basis would be highly appreaciated.
Comment #15
jviitamaki CreditAttribution: jviitamaki at Citrus Solutions Oy commentedHere's a patch that allows using of configured exports in export csv form while also retaining the original weirdish user data features.