Problem/Motivation
I needed to install devel_entity_updates on my core/contrib environment because the new drupal core path_alias module didn't update the PathAlias correctly when i updated 9.0.x branch. However with drush/drush:^10, entup fails with the following error:
[error] Error: Call to undefined function Drupal\devel_entity_updates\Commands\drush_drupal_cache_clear_all() in Drupal\devel_entity_updates
\Commands\DevelEntityUpdatesCommands->entityUpdates() (line 66 of /var/www/html/modules/devel_entity_updates/src/Commands/DevelEntityUpdatesCo
mmands.php)
Proposed resolution
Remaining tasks
API changes
Probably
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | drush_drupal_cache_clear_all_drush10-3093421-9.patch | 2.34 KB | arkener |
| #6 | drush_drupal_cache_clear_all_drush10-3093421-6.patch | 1.28 KB | arkener |
Comments
Comment #2
mradcliffeNote, the functionality still works, but the command fails afterward.
Comment #3
plachCould you please provide also the steps to reproduce the original error with path_alias? It might be something worth fixing in core rather than relying on drush entup.
Of course we also need to take care of the error reported in the IS.
Comment #4
mradcliffeI don't think there is an issue with a releasable version of core.
I was on 9.0.x from probably last weekend, installed Drupal minimal, did some things, realized I was out-of-date, updated, ran database updates, then status was reporting the entity definitions needed to be updated.
I'm not sure on the exact commit I was on in 9.0.x, but I think it was before path_alias module. I'm not too worried about it being a core issue.
Comment #5
plachOk, thanks for the info.
Comment #6
arkener commenteddrush_drupal_cache_clear_all() has been removed from Drush 10. The attached patch which will fix the cache clear functionality on both Drush9 and Drush10.
Comment #7
plachThis will make the new release require Drush 9.6.0 and above. We need to add a
composer.jsonfile making this requirement explicit.Comment #8
plach@Arkener:
Thanks for the patch, btw! Much appreciated :)
Comment #9
arkener commentedGood catch! I've added a composer.json file with a dependency on 9.6, when using Drush 9.
Comment #10
mortona2k commented+1 for #9.
The patch applies to 8.8.0 and works without error.
The code looks good - it creates composer.json and uses SiteAlias to call the drush clear cache command instead of drush_drupal_cache_clear_all() as per the change record mentioned in #6.
Comment #11
joelpittetSeemed to fix the drush integration and is straight forward
Comment #12
plachThe patch looks great, but I was wondering on a second thought whether it would make sense to just check whether the
drush_drupal_cache_clear_all()function exists and only use the new logic if it doesn't, this way we can keep BC with older Drush versions. Thecomposer.jsonlooks great and could stay, we would only need to strip out theconflictsection.Comment #13
arkener commentedThe issue with checking if the
drush_drupal_cache_clear_all()function exists is the fact that the Consolidation based SiteAliasManagerAware implementations aren't available until Drush 9.4. This means that we'd have to implementDrush::aliasManager()->getSelf();to retrieve the current site alias. This implementation has been deprecated on Drush 9.6, which most likely means that this issue will return whenDrush::aliasManager()->getSelf();is removed.Comment #14
joelpittet@plach what about cutting a 2.x version for this and avoid the BC "standing on your head" workarounds?
Comment #16
plach@joelpittet:
Good call! Committed and pushed to 8.x-2.x, thanks!
Comment #17
plachComment #18
joelpittetSweet, thanks @plach and @Arkener!