- π³π±Netherlands Floris Vedder
I did an attempt to refactor the patch.
Refactoring of the patch mostly is about moving the additions from xmlsitemap.drush.inc to src/Commands/XmlSitemapCommands.php
But I didn't get it to work.After that I tested the normal `drush xmlsitemap:rebuild` command which worked well for our scenario.
Number of records in xmlsitemap: 3400
Memory Limit setting: 256MSo the patch seems obsolete for our case.
I also did a test with the #21 patch on the 1.3.0 version of xmlsitemap in combination with drupal core 9.4.8. Expecting that it worked but in my case it didn't. The drush command `drush xmlsitemap-queue-rebuild` wasn't recognized.
Additionally the patch seems not to take entity types without bundles into account. Therefore the patch fails in that case on: $entity_type->getKey('bundle'). I partly fixed that with an $entity_type->hasKey('bundle') check.
Since the patch seemed already broken or at least not working for our scenario with the 1.3.0. version and a recent drupal core version. And since the already available `xmlsitemap-rebuild` command works fine in our scenario. I decided to not further investigate and/or refactor the patch for 1.4.0. With the WIP for 1.4.0 the drush command works, but in my case it didn't fill the queue table.
But maybe for future use or for someone else the WIP is usefull, so therefore it's added with this comment.
As said it isn't ready for (production) usage yet. To apply it as a patch you'd probably have to change the extension from .txt to .patch. I still have an interest in this feature/patch. Hoping someone can pick this back up.