Problem/Motivation
The module in some cases sends the wrong URL to the Siteimprove plugin when the frontpage is an entity, or sends the URLs in the wrong order. This causes that the Siteimprove plugin can't recognize the page.
When a node or taxonomy term entity is configured as the frontpage in the basic site settings, is the plugin both sending the canonical entity route (or alias) and the base URL. This cause problems when the canonical entity route is listed first in the array of URLs send to the plugin.
Furthermore does it sometimes cause problems in multilingual configurations, when the URL prefix is used to detect language and no redirect is setup from the base URL to default language code. The Siteimprove crawler will crawl the base URL e.g. www.example.com, but Drupal returns the URL www.example.com/es to the plugin.
Finally does the Siteimprove crawler sometimes crawl the frontpage with a traling slash (e.g. www.example.com/), which Drupal does use in most cases. This triggers the same issue with the plugin not able to recognize the page, when Drupal sends www.example.com to the plugin.
When running Domain Access will the URLs in some cases be returned without with a scheme, when entity is not published on any domains. This could happen if content is created before domain access was enabled and configured. The missing scheme triggers the same problem in the Siteimprove plugin.
Proposed resolution
Rewrite the logic in getEntityUrls() to handle the above cases. The changes should be implemented in all supported versions.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | siteimprove-3591528-fix-incorrect-frontpage-urls.patch | 2.82 KB | mukeshaddweb |
Issue fork siteimprove-3591528
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
mukeshaddweb commentedAttached a patch that reorders the URLs for frontpage entities, drops the fromRoute('') call, adds both slash variants for the base domain, and includes a normalizeDomain() helper to handle missing schemes from Domain Access.
Comment #11
beltofte@mukeshaddweb Welcome to the Drupal community and thanks for your patch. I already had implemented a similar solution outside drupal.org that had been tested and approved by Siteimprove. So I went with those code changes.