Closed (outdated)
Project:
Default Content
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
30 Jun 2016 at 19:36 UTC
Updated:
28 Apr 2021 at 17:57 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
-enzo- commentedI did two Drupal Console commands
[generate:default:content] entity-type entity-id --module
[generae:default:content:taxonomy] vocabulary id --module
Both commands allow users to select the module they want to use to export the entities, the name of file exported in automatically calculated base in entity name property.
Comment #3
larowlan%s/a/all
%s/taxonomy terms/taxonomy terms to
%s/at/to
%s/export/export to
%s/at/to
%s/export/export to
nit: phpcs issues here
Can we give these better names, vocabularyStorage and termStorage?
Can we call this what it is - vocabulary?
no need to quote
Does console support batching? This could be a very slow process on a big vocabulary? Can we use the symfony progress indicator to give some visual feedback?
Comment #4
-enzo- commentedI applied almost all suggestion you did, except by phpcs, feel free to apply after merge if you decide to apply the patch.
About symfony progress, it's totally possible, but I didn't use before.
Comment #5
-enzo- commentedIgnore the previous patch file
Comment #6
darol100 commentedHere is the interdiff
Comment #7
greg.1.anderson commented-enzo-, did you see #2703131? @jmolivas and @darol100 and I worked quite a bit on trying to get to a point where it would be possible for Drupal 8 contrib modules to provide cli tools that run with both Drush and Drupal Console. Are you interested in this sort of collaboration?
Also, Robo-PHP (http://robo.li) provides easy integration with the Symfony Progress component. Not that it's difficult to use the API directly either, but there was some interest in investigating using teh Robo task runner in Drupal Console. This might be as good a time as any to look into this.
Comment #8
-enzo- commentedHi @greg.1.anderson
To be honest, I did the command before I discover there was an intention to work in that direction, I just need to run these commands with Drupal Console so I just did
About the effort to work towards standard tools, there is something not quite that stable. We (Drupal Console Team) want to focus our efforts first in getting our first 1.0.0 stable release
Comment #9
avibrazil@gmail.com commentedPlease advise about which patch to use (#5 ?) against which version of the module (-dev ?) to make it usable with Drupal Console.
Thank you
Comment #10
-enzo- commentedYou need to apply the patch against branch 8.x-1.x-dev
Comment #11
-enzo- commentedNew patch to prepare changes for Drupal Console RC1
Comment #12
-enzo- commentedHi @avi
If you install Drupal 8 using the Drupal Composer project using a command like this
You only need to edit your composer.json file to add this dependencies
To apply the patch only add the proper instruction in composer.json files
After save, you just need to run composer install
Comment #13
miguelc303 commentedI did a new Drupal Console command
default:content:export:menu parent-menu --module
The command allow users to export all menu content for a specific parent menu and select the module they want to use to export the entities.
Comment #14
glynnr commentedUsing this patch I get the following error:
Error: Call to undefined method Drupal\user\Entity\User::getName() in contrib/default_content/src/Command/DefaultExportCommand.php on line 80Error: Call to undefined method Drupal\node\Entity\Node::getName() in contrib/default_content/src/Command/DefaultExportCommand.php on line 80Perhaps it would be better to use ID? Attached patch for this.
Comment #15
glynnr commentedAlso, could be quite useful to be able to export all entities of a type, which I would like to do, so here is a patch for that.
With this you can go :
drupal default:content:export node allComment #17
glynnr commentedSorry last patch is incorrect. This one should work.
Comment #18
glynnr commentedComment #19
pguillard commentedComment #21
andypostDrush 9 issue fixed #2912723: Add Drush 9 support
Comment #22
ivnishWhy drupal console?
The https://www.drupal.org/project/default_content_deploy module has drush commands to export and import
Comment #23
marios anagnostopoulos commentedI am taking the liberty to close this issue since it is outdated. Last relevant comment was 5 years ago, and the module has implemented the drush approach. Also the drupal console project seems to be on some kind of hiatus anyway.
If there are any objections with closing this feel free to reopen it.