in drush 9 following command:

drush demo-content-add file user group topic event event_enrollment comment post like

Command "demo-content-add" is not defined.

Comments

mailfox created an issue. See original summary.

jaapjan’s picture

Category: Feature request » Support request
Priority: Normal » Minor
Status: Active » Postponed (maintainer needs more info)
Issue tags: -drush

Hi mailfox,

My guess is that Social Demo module was not enabled on your installation. What if you first enable social_demo with drush en social_demo -y? After that the command should be available (tested on drush version 8.1.16.).

mailfox’s picture

the module social_demo is enabled (drush version 9.2.1)

nigelwhite’s picture

Same here.

I confirm that social_demo is enabled.

Drush 9.2.3 on LAMP

karunadave’s picture

Yes similar

on a fresh composer install, after running:

vendor/drush/drush/drush pm-enable social_demo -y
vendor/drush/drush/drush cache-rebuild
vendor/drush/drush/drush demo-content-add file user group topic event event_enrollment comment post like

receive:

[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "demo-content-add" is not defined.

apratt’s picture

Looks like the drush command needs to be ported to rush 9. I'm following Moshe's tutorial at https://weitzman.github.io/blog/port-to-drush9 but will probalbly need some help to finish it off as this is not my area of expertise.

apratt’s picture

StatusFileSize
new135 bytes
new435 bytes
new5.41 KB

Looks like the new drush is breaking a lot of things so maybe this isn't so minor an issue?

I'm attaching my shot at adding the Drush 9 command. It definitely needs clean up. It can apparently co-exist with the Drush 8 commands but again I'm not an expert.

Note the composer.json.yml needs to be renamed. Had to get it past the upload limitation. composer.json is the required name.
And a similar problem for the SocialDemoCommands.php file. It goes in the src/Commands folder.

And when I clear registry and install it I get the following error (running with --debug flag):

In DrushArgvInput.php line 193:
                                                                     
  [Symfony\Component\Console\Exception\RuntimeException]             
  Too many arguments, expected arguments "command" "content_types".  
                                                                     

Exception trace:
 Drush\Symfony\DrushArgvInput->parseArgument() at /home/angus/Projects/cancer.test/social/vendor/drush/drush/src/Symfony/DrushArgvInput.php:92
 Drush\Symfony\DrushArgvInput->parse() at /home/angus/Projects/cancer.test/social/vendor/symfony/console/Input/Input.php:55
 Symfony\Component\Console\Input\Input->bind() at /home/angus/Projects/cancer.test/social/vendor/symfony/console/Command/Command.php:210
 Symfony\Component\Console\Command\Command->run() at /home/angus/Projects/cancer.test/social/vendor/symfony/console/Application.php:964
 Symfony\Component\Console\Application->doRunCommand() at /home/angus/Projects/cancer.test/social/vendor/symfony/console/Application.php:248
 Symfony\Component\Console\Application->doRun() at /home/angus/Projects/cancer.test/social/vendor/symfony/console/Application.php:148
 Symfony\Component\Console\Application->run() at /home/angus/Projects/cancer.test/social/vendor/drush/drush/src/Runtime/Runtime.php:112
 Drush\Runtime\Runtime->doRun() at /home/angus/Projects/cancer.test/social/vendor/drush/drush/src/Runtime/Runtime.php:41
 Drush\Runtime\Runtime->run() at /home/angus/Projects/cancer.test/social/vendor/drush/drush/drush.php:66
 require() at /home/angus/Projects/cancer.test/social/vendor/drush/drush/drush:4

demo:content-add [--module [MODULE]] [--profile [PROFILE]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-d|--debug] [-y|--yes] [--no] [--remote-host REMOTE-HOST] [--remote-user REMOTE-USER] [-r|--root ROOT] [-l|--uri URI] [--simulate] [--pipe] [-D|--define DEFINE] [--xh-link XH-LINK] [--notify [NOTIFY]] [--druplicon] [--] <command> <content_types>
jaapjan’s picture

Title: Command "demo-content-add" is not defined. » Add support for Drush 9 "demo-content-add"
Category: Support request » Task
Status: Postponed (maintainer needs more info) » Active

You are right that it seems to be a Drush 9 issue. I can't install drush 9 now and I personally don't have time to work on this. But feel free to pick this up.

ronaldtebrake’s picture

robpowell’s picture

StatusFileSize
new8.17 KB

@apratt, thanks for giving this update a shot! Since it was 10 months ago, I bet you've gotten more familiar with providing patches for review but just in case I wanted to give you this link, #707484: Making a patch. If you have questions, let me know and I can assist.

I went ahead and started from scratch. In terms of the steps laid out in the mosh update guide, I ran the generate command and have copied over each function to its rightful annotated method. I have begun building at contentAdd method. This is very much so a work in progress and has comments commenting out the Drush 8 code above all new Drush 9 code. In terms of status of contentAdd, I believe it is ready to be tested.

I'll continue working on this over the weekend just wanted to post my progress.

robpowell’s picture

Assigned: Unassigned » robpowell
robpowell’s picture

StatusFileSize
new7.63 KB
new1.72 KB

A few small changes before beginning to test locally

kingdutch’s picture

Version: 8.x-1.11 » 8.x-6.x-dev
Status: Active » Needs review

Updating status : )

alexberendei’s picture

I've tested the #12 patch with devel 9.7.1 & open social 8.x-6.2 with the command: demo-content-add file user group topic event event_enrollment comment post like but it gives Too many arguments, expected arguments "command" "content_types". error.

jaapjan’s picture

Status: Needs review » Needs work

Marking as needs work as per #14.

yusufhm’s picture

Status: Needs work » Needs review
StatusFileSize
new6.58 KB
new7.47 KB

Hey guys, was just trying out Open Social and had to get this command working; I've attached an updated patch. I've removed composer.json, I don't think it's required.

deaom’s picture

Status: Needs review » Reviewed & tested by the community

The patch #16 is working. The drush command can be executed without errors even with drush 10.3. The only problem I've got (I think it needs to be a separate issue if it's not already) was that post content was not created, because it's not present as available content type. I'm marking this as RTBC as it did add the demo content and that was the main issue.

 [error]  Entity post with uuid: 0e6f055d-7141-4a6c-9ea2-2426b436733c doesn't exists. 
 [error]  Entity post with uuid: 1fcdeab4-0ba3-11e6-b512-3e1d05defe78 doesn't exists. 
 [error]  Entity post with uuid: 1fcddf42-0ba3-11e6-b512-3e1d05defe78 doesn't exists. 
 [error]  Entity post with uuid: 1fcddf42-0ba3-11e6-b512-3e1d05defe78 doesn't exists. 
 [error]  Entity post with uuid: 1fcde532-0ba3-11e6-b512-3e1d05defe78 doesn't exists. 
 [error]  Entity post with uuid: 1fcde532-0ba3-11e6-b512-3e1d05defe78 doesn't exists. 
 [error]  Entity post with uuid: 1fcde24e-0ba3-11e6-b512-3e1d05defe78 doesn't exists. 
 [error]  Entity post with uuid: 1fcde532-0ba3-11e6-b512-3e1d05defe78 doesn't exists. 
 [error]  Entity post with uuid: 1fcde532-0ba3-11e6-b512-3e1d05defe78 doesn't exists. 
 [error]  Entity post with uuid: 1fcde532-0ba3-11e6-b512-3e1d05defe78 doesn't exists. 
 [error]  Entity post with uuid: 4b4d3908-46c9-11e7-a919-92ebcb67fe33 doesn't exists. 
 [error]  Entity post with uuid: 4b4d3908-46c9-11e7-a919-92ebcb67fe33 doesn't exists. 
 [error]  Entity post with uuid: a46c82ce-4a88-11e7-a919-92ebcb67fe33 doesn't exists. 
ronaldtebrake’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -OSBounty-DrupalConEU2019

This should be part of 11.0.0, let us know if you have any feedback after running this

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.