learning-drupal-as-a-framework
learning-drupal-as-a-framework copied to clipboard
Drush Command Issue
When I run the the drush offer-create-seeds
command, I get the following error in the terminal:
Command "offer-create-seeds" is not defined.
However if I move the following code from the offer.services.yml
into a drush.services.yml
in the offer module folder it works:
services:
offer.commands:
class: \Drupal\offer\Commands\SeedGeneratorCommand
tags:
- { name: drush.command }
The only issue, and I'm not sure if it matters at this point, is you get the following error after running the drush command:
In Query.php line 141:
Entity queries must explicitly set whether the query should be access checked
or not. See Drupal\Core\Entity\Query\QueryInterface::accessCheck().
I see, you are probably on Drupal 10. I'll fix this quickly and let you know in here!
More here: https://stefvanlooveren.me/blog/entityquery-access-check-will-be-enforced-drupal-10
Can you check out https://github.com/stef-van-looveren/learning-drupal-as-a-framework/commit/618472fc7eae3d07cc350c8a4378af491f1aa95a
This fixes it. I do not know yet why it is not working in Drush 12. Drush.services.yml will be deprecated in the future so I would not recommend. Thank you for logging this, btw!
@stef-van-looveren maybe you can check this issue discussion https://github.com/drush-ops/drush/issues/5600