According to the #3015295: Integrate into 3.x of simple_sitemap, I create this issue and attach a patch that adds support for the Views module.
| Comment | File | Size | Author |
|---|---|---|---|
| views-support.patch | 62.08 KB | walkingdexter |
According to the #3015295: Integrate into 3.x of simple_sitemap, I create this issue and attach a patch that adds support for the Views module.
| Comment | File | Size | Author |
|---|---|---|---|
| views-support.patch | 62.08 KB | walkingdexter |
Comments
Comment #2
gbyteComment #3
gbyteThat's some quality code, thank you for contributing! This will be a great feature for 3.1 or later release. There are a few minor things that need to be addressed:
Also if you would like to continue working on the module in a more permanent basis, I can grant maintainer status.
Comment #4
walkingdexter commented- Views URLs are not associated with content entities.
- Extending the EntityUrlGeneratorBase will result in the injection of unnecessary services. For example, the EntityHelper service.
For the formation of Views URLs only two EntityUrlGeneratorBase methods are important - generate() and getAlternateUrlsForAllLanguages(). Do you think it is right to move these methods to UrlGeneratorBase?
I will be glad to receive the maintainer status. However, I can not guarantee that I can find enough time to developing the module.
Comment #5
gbyte1. This is a valid concern, however I believe Injecting these services is not a big problem as they are probably loaded anyway. Even if they cost additional resources, the code de-duplication makes it worthwhile.
4. We need at least one functional test testing the indexation of a view with arguments. The submodule's code is strongly tied to the main module making it vulnerable to any changes. So we need a functional test testing if view indexation works after any changes are made.
If you look into Drupal\Tests\simple_sitemap\Functional\SimplesitemapTest, you will see the tests are mostly simple browser tests and not very extensive, but I've been trying to cover most functional aspects of the module.
I understand if you don't have much time for contrib work - neither do I. ;) But if you think you can be of help sometimes to answer in the issue queue or discuss some technicality with me, I think it's worth considering. I like your coding style and now you understand the module's internals well, this is why I asked. Your decision!
Comment #6
walkingdexter commentedWell, I think it's worth a try :)
Comment #7
gbyteYou can push to the repo now. The views functionality needs its own feature branch until we have tests and 3.0 has been released. Cool to have you on board!
Comment #8
walkingdexter commented@gbyte.co, I created a feature branch and made changes to it according to the above comments (see the commit log for details).
I have two questions:
Comment #9
walkingdexter commentedComment #10
gbyteAfter some thinking, I recon the 'enable views support' does not make much sense, as the only thing this module does is adding support for views. In addition, it is confusing to have to enable the module and then into the settings to enable views support. I like the list of indexed views however. What do you think about removing the 'views support' button?
Also, there seems to be something off with the UI/js when indexing the view, see screenshot.
I feel good about the code, feel free to merge with develop branch any time. But I would feel much better with some tests. ;)
Comment #11
gbyteComment #12
walkingdexter commentedI agree, it is better to remove this option. After that, the "Sitemap views" page will display only the list of indexed displays.
I could not reproduce this problem in recent versions of Chrome and Firefox. Which browser are you using (version will also be helpful)? Are there any JavaScript errors?
Cool :)
Comment #13
gbyteDon't worry about it as I could not reproduce it just now, maybe it was some browser error. It was Friefox 64.0.2 on Arch Linux.
Comment #14
dercheffeThere's already a views support module: https://www.drupal.org/project/simple_sitemap_views. Perhaps it can be merged/forked into this module?
Comment #15
walkingdexter commented@dercheffe, this is already in progress :) I am the maintainer of the simple_sitemap_views module.
Comment #16
dercheffe@WalkingDexter now I've seen the referenced issue, sorry :)
Comment #17
gbyte@WalkingDexter I've pushed a couple of commits of mine to improve the integration and I am happy. Feel free to merge this into dev if you agree.
Comment #18
walkingdexter commented@gbyte.co I want to add the following tests:
If you think that these tests don't really matter now (we can add them later), then I agree to merge the changes into the dev branch.
Comment #19
gbyteYou can merge it and add the tests to dev afterwards. Would be nice to publish 3.1 with views support and xsl stylesheets soon. :)
Comment #20
walkingdexter commentedMerged 3017271-views-support into 8.x-3.x.