Problem/Motivation
After enabling and configuring the module and creating a Content Model entity, I am not able to export it via Drush. Drush cannot find the command.
$ drush content-model-documentation:export 1
There are no commands defined in the "content-model-documentation" namespace.
drush list does not list any of the module's commands.
I've cleared caches several times, and wiggled and tweaked anything I could to try to make it work. I've also taken a look at the code and don't see anything that stands out as incorrect/broken. So, unfortunately I don't have much to offer in the way of solutions atm. Possible Drush version issue or a change in the way Drush Commands are created that was not expected?
OTOH, I was able to do a drush generate drush:command-file for a custom module, and that command was immediately available.
Drupal version: 10.1.8
Drush version: 12.1.3.0
PHP version: 8.1.18
Steps to reproduce
1. Enable the module.
2. Go to /admin/structure/cm_document and create a new Content Model.
3. On /admin/structure/cm_document, hover over the "Edit" button for your new content model to find the id.
4. In your terminal, run drush content-model-documentation:export [your id]
Issue fork content_model_documentation-3427908
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 #2
swirtHi @majorrobot. Thank you for reporting this issue.
I am not seeing this on two different sites that I have up running the module.
Can you verify two things
I doubt it is #2 as it would not prevent the drush command from existing. It would only throw back an error like this:
Is it possible that your drush is running generically (outside of your site) so it is only giving you basic commands but not commands declared by your site? Your test of drush generate was a good start, but that would likely run without being connected to your site. Running "drush status" might give you info about whether it is actually acting on your site. Are there any other contrib modules in your site that also have drush commands you could test?
Comment #3
swirtActually, nevermind.. I see the problem. The command does not work with drush 12.
I will try to track down the fix and get this resolved.
Comment #4
swirtComment #6
swirtThe current state of the PR is that it works with drush 12 but breaks with 11. :(
Comment #7
swirtFixed, tested with both drush 11 and 12. Import and export work as expected.
Comment #9
swirtComment #10
swirtWent out with https://www.drupal.org/project/content_model_documentation/releases/1.0.27