Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UHF-8514: Add patch for simple_sitemap module. #572

Merged
merged 1 commit into from
Aug 29, 2023

Conversation

juho-lehmonen
Copy link
Contributor

@juho-lehmonen juho-lehmonen commented Aug 29, 2023

UHF-8514

What was done

This PR adds a patch to fix frontpage handling in sitemap.xml.

Replicate issue

  • Make sure your instance (for example KASKO or KYMP) is up and running on latest dev branch.
    • git pull origin dev
    • make fresh
  • Go to /admin/config/search/simplesitemap and click "Rebuid queue & generate"
  • Go to /sitemap.xml and find the wrongly formatted frontpage URLs, should be something like:
    • https://helfi-kasko.docker.so/fi/kasvatus-ja-koulutus/kasvatus-ja-koulutus
    • https://helfi-rekry.docker.so/fi/avoimet-tyopaikat/avoimet-tyopaikat
    • https://helfi-kymp.docker.so/fi/kaupunkiymparisto-ja-liikenne/kaupunkiymparisto-ja-liikenne

How to install fix

  • Update the Helfi Platform config
    • composer require drupal/helfi_platform_config:dev-UHF-8514-patch-sitemap-to-fix-frontpage-urls
  • Make sure the patch is applied by running composer install again, you should see this output:
    • Applying patches for drupal/simple_sitemap https://www.drupal.org/files/issues/2022-02-15/3264573-2.patch
  • Run drush cr

How to test

  • Make a copy of the old version of the sitemap.xml file for comparison
  • Rebuild and generate the sitemap again
  • Now when you refresh the sitemap.xml, the frontpage URLs should be correctly formatted, such as:
    • https://helfi-kasko.docker.so/fi/kasvatus-ja-koulutus/kasvatus-ja-koulutus
    • https://helfi-rekry.docker.so/fi/avoimet-tyopaikat
    • https://helfi-kymp.docker.so/fi/kaupunkiymparisto-ja-liikenne
  • Compare the old sitemap.xml version to the new one. Does it have any other differences or broken links caused by this change?

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@codecov-commenter
Copy link

codecov-commenter commented Aug 29, 2023

Codecov Report

Merging #572 (2f4488e) into main (f950e0a) will not change coverage.
The diff coverage is n/a.

❗ Current head 2f4488e differs from pull request most recent head f5baa25. Consider uploading reports for the commit f5baa25 to get more accurate results

@@            Coverage Diff            @@
##               main     #572   +/-   ##
=========================================
  Coverage     12.74%   12.74%           
  Complexity      236      236           
=========================================
  Files            30       30           
  Lines           902      902           
=========================================
  Hits            115      115           
  Misses          787      787           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@hyrsky hyrsky self-requested a review August 29, 2023 07:13
@juho-lehmonen juho-lehmonen marked this pull request as ready for review August 29, 2023 07:34
Copy link
Contributor

@hyrsky hyrsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sitemap diff with this branch:

197,200c197,200
<   <loc>https://helfi-kasko.docker.so/fi/kasvatus-ja-koulutus/kasvatus-ja-koulutus</loc>
<   <xhtml:link rel="alternate" hreflang="fi" href="https://helfi-kasko.docker.so/fi/kasvatus-ja-koulutus/kasvatus-ja-koulutus"/>
<   <xhtml:link rel="alternate" hreflang="sv" href="https://helfi-kasko.docker.so/sv/fostran-och-utbildning/fostran-och-utbildning"/>
<   <xhtml:link rel="alternate" hreflang="en" href="https://helfi-kasko.docker.so/en/childhood-and-education/childhood-and-education"/>
---
>   <loc>https://helfi-kasko.docker.so/fi/kasvatus-ja-koulutus</loc>
>   <xhtml:link rel="alternate" hreflang="fi" href="https://helfi-kasko.docker.so/fi/kasvatus-ja-koulutus"/>
>   <xhtml:link rel="alternate" hreflang="sv" href="https://helfi-kasko.docker.so/sv/fostran-och-utbildning"/>
>   <xhtml:link rel="alternate" hreflang="en" href="https://helfi-kasko.docker.so/en/childhood-and-education"/>
205,208c205,208
<   <loc>https://helfi-kasko.docker.so/sv/fostran-och-utbildning/fostran-och-utbildning</loc>
<   <xhtml:link rel="alternate" hreflang="fi" href="https://helfi-kasko.docker.so/fi/kasvatus-ja-koulutus/kasvatus-ja-koulutus"/>
<   <xhtml:link rel="alternate" hreflang="sv" href="https://helfi-kasko.docker.so/sv/fostran-och-utbildning/fostran-och-utbildning"/>
<   <xhtml:link rel="alternate" hreflang="en" href="https://helfi-kasko.docker.so/en/childhood-and-education/childhood-and-education"/>
---
>   <loc>https://helfi-kasko.docker.so/sv/fostran-och-utbildning</loc>
>   <xhtml:link rel="alternate" hreflang="fi" href="https://helfi-kasko.docker.so/fi/kasvatus-ja-koulutus"/>
>   <xhtml:link rel="alternate" hreflang="sv" href="https://helfi-kasko.docker.so/sv/fostran-och-utbildning"/>
>   <xhtml:link rel="alternate" hreflang="en" href="https://helfi-kasko.docker.so/en/childhood-and-education"/>
213,216c213,216
<   <loc>https://helfi-kasko.docker.so/en/childhood-and-education/childhood-and-education</loc>
<   <xhtml:link rel="alternate" hreflang="fi" href="https://helfi-kasko.docker.so/fi/kasvatus-ja-koulutus/kasvatus-ja-koulutus"/>
<   <xhtml:link rel="alternate" hreflang="sv" href="https://helfi-kasko.docker.so/sv/fostran-och-utbildning/fostran-och-utbildning"/>
<   <xhtml:link rel="alternate" hreflang="en" href="https://helfi-kasko.docker.so/en/childhood-and-education/childhood-and-education"/>
---
>   <loc>https://helfi-kasko.docker.so/en/childhood-and-education</loc>
>   <xhtml:link rel="alternate" hreflang="fi" href="https://helfi-kasko.docker.so/fi/kasvatus-ja-koulutus"/>
>   <xhtml:link rel="alternate" hreflang="sv" href="https://helfi-kasko.docker.so/sv/fostran-och-utbildning"/>
>   <xhtml:link rel="alternate" hreflang="en" href="https://helfi-kasko.docker.so/en/childhood-and-education"/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants