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.

Command icon 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

beltofte created an issue. See original summary.

mukeshaddweb’s picture

Status: Active » Needs review
StatusFileSize
new2.82 KB

Attached 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.

  • beltofte committed 7a319046 on 3.0.x
    fix: #3591528 Wrong URL send to Siteimprove when frontpage is an entity
    

beltofte changed the visibility of the branch 3591528-wrong-url-send-2.0.x to hidden.

beltofte changed the visibility of the branch 3591528-wrong-url-send-2.0.x to active.

  • beltofte committed 05b1ae2f on 3.0.x
    fix: #3591528 Wrong URL send to Siteimprove when frontpage is an entity
    

  • beltofte committed 5eadf15b on 2.0.x
    fix: #3591528 Wrong URL send to Siteimprove when frontpage is an entity
    
beltofte’s picture

Status: Needs review » Fixed

@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.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • beltofte committed 5eadf15b on 3590123-fix-warning-2.0.x
    fix: #3591528 Wrong URL send to Siteimprove when frontpage is an entity