Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem/Motivation
xmlsitemap does not presently work with Drush 9.
Proposed resolution
Add drush 9 support.
Comment | File | Size | Author |
---|---|---|---|
#12 | 2968172-drush9.patch | 6.5 KB | Dave Reid |
| |||
#11 | xmlsitemap--2968172-drush-9-support--11.patch | 6.42 KB | hanoii |
| |||
#6 | 0001-Issue-2968172-by-WidgetsBurritos-fgm-Support-Drush-9.patch | 7.84 KB | fgm |
#2 | xmlsitemap--2968172-drush-9-support--2.patch | 4.23 KB | WidgetsBurritos |
Comments
Comment #2
WidgetsBurritos CreditAttribution: WidgetsBurritos at Rackspace commentedThis patch is a minor refactor which should provide basic drush 9 support, although it probably should be thoroughly tested.
Basic file structure was auto generated with "drush generate drush-command-file" and then I just performed some minor modifications based on some feedback I saw here: https://weitzman.github.io/blog/port-to-drush9
Comment #3
bighappyface CreditAttribution: bighappyface at Rackspace commented+1 LGTM
Testing results:
Comment #4
dpiWorks as expected.
Comment #5
fgmThe patch needs to include a
composer.json
, as indicated in the source. Without that file, Drush 9.3 does't find the services file.Comment #6
fgmAdded composer.json
Also:
- fixed coding standards in the Commands file
- Added the required comments about open route access in routing files
Comment #7
fgmFWIW, the test errors appear to be unrelated to the Drush issue, but pertain with missing dependencies on "robotstxt" module and incorrect xmlsitemap storage operation with regard to the test.
Comment #8
fgmFTR, works with Drush 9.3.0 too.
Comment #9
m4oliveiLooks good! Just a couple of nit picks from me. I'll follow up with a patch.
Can we use the same casing as other existing classes? This should change to XmlSitemapCommands.
Should we take the opportunity to update this to use dependency injection rather than a deprecated function?
Same here.
Comment #10
m4oliveiHere is an updated patch from #6 with interdiff.
Comment #11
hanoiiRe-rolling #10, it was adding composer.json while it's already there so the patch was failing.
Comment #12
Dave ReidI tested this out and I was having issues running xmlsitemap-index, as the $limit variable was always being set to 0. For some reason calling $configFactory->get() in the constructor was returning a DrushConfig object instead of a normal core Config object, hence batch_limit was never set. If I just leave the config factory alone and read the variable when the command is getting run, it works as expected.
I also re-added the composer.json segment for the drush.service.yml, and added a suggest for drush.
Comment #14
Dave ReidTested and confirmed things are working. Committed #12 to 8.x-1.x. Thanks everyone!