Some links in language tour contains double slash. Technically they are not broken but cause server to make 302 redirect.
http://example.com//</strong>admin/config/regional/language

I guess the [site:url] token already ends with a trailing slash.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Chi created an issue. See original summary.

Chi’s picture

Component: language system » language.module
poornima.n’s picture

Can you please upload the screen shot

Chi’s picture

@poornima.n what screenshot?

bhide.nishad’s picture

Assigned: Unassigned » bhide.nishad
bhide.nishad’s picture

Assigned: bhide.nishad » Unassigned
Status: Active » Needs review
FileSize
3.27 KB

@Chi ! you were correct, [site:url] token already ends with a trailing slash.
Corrected the URLs, please find the attached patch.

Thanks,
Nishad

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Chi’s picture

Status: Needs review » Reviewed & tested by the community

Looks good for me. Thanks.

alexpott’s picture

Title: Wrong links in Language tour » Wrong links in tours (eg. Language and Locale)
Status: Reviewed & tested by the community » Needs work

At first I wondered if the behaviour of the site:url token had changed in Drupal 8 compared to 7. It has not:

Psy Shell v0.7.0 (PHP 7.0.7 — cli) by Justin Hileman
>>> $result = \Drupal::url('<front>', array(), ['absolute' => TRUE], TRUE);
=> Drupal\Core\GeneratedUrl {#12633}
>>> $result->getGeneratedUrl();
=> "http://drupal8alt.dev/"
>>> \Drupal::VERSION
=> "8.3.0-dev"
Psy Shell v0.7.0 (PHP 7.0.7 — cli) by Justin Hileman
>>> url('<front>', ['absolute' => TRUE])
=> "http://default/"
>>> DRUPAL_VERSION;
PHP error:  Use of undefined constant DRUPAL_VERSION - assumed 'DRUPAL_VERSION' on line 1
>>> VERSION
=> "7.51-dev"

So the change looks correct..

+++ b/core/modules/language/config/optional/tour.tour.language-add.yml
@@ -25,5 +25,5 @@ tips:
-    body: '<p>Now that you have an overview of the "Add languages" feature, you can continue by:<ul><li>Adding a language</li><li>Adding a custom language</li><li><a href="[site:url]/admin/config/regional/language">Viewing configured languages</a></li></ul></p>'
+    body: '<p>Now that you have an overview of the "Add languages" feature, you can continue by:<ul><li>Adding a language</li><li>Adding a custom language</li><li><a href="[site:url]admin/config/regional/language">Viewing configured languages</a></li></ul></p>'

The original version reads nicer - but the new version is definitely correct. However there are more tours to fix - we should fix all the tours in core. Given this is a configuration change we also should consider an upgrade path. However, given that the links work and just cause a 302 I think we shouldn't bother with that.

chishah92’s picture

Assigned: Unassigned » chishah92
chishah92’s picture

Have corrected in all tours in the core with this new patch.

Thanks
~Chirag

bhide.nishad’s picture

Assigned: chishah92 » Unassigned

As per the previous finding there were only issue in language and local module.
So this issue was considered for language module.

For local module, another issue https://www.drupal.org/node/2797663 was logged.

Thanks,
Nishad

tresti88’s picture

FileSize
170.57 KB
104.74 KB

Hi,

Tested this patch in 8.2 dev see attached screen shot before the patch was applied and after. All is good.

tresti88’s picture

Status: Needs review » Reviewed & tested by the community
alexpott’s picture

"[site:url]/" not found in the code anymore. Looks good - updating issue credits.

alexpott’s picture

Status: Reviewed & tested by the community » Patch (to be ported)

Committed 554852c and pushed to 8.3.x. Thanks!

Leaving to be cherry-picked into 8.2.x once 8.2.0 is released.

  • alexpott committed 554852c on 8.3.x
    Issue #2791727 by bhide.nishad, chishah92, tresti88, Chi: Wrong links in...
LiamPower’s picture

Issue tags: +Dublin2016

Patch #11 works and still applies cleanly for 8.2.

I had been looking at this as part of the Mentored sprints at DC Dublin 2016

AdamB’s picture

Been looking at this as part of the Mentored Sprints at DrupalCon Dublin 2016.

Agree Patch #11 applies cleanly for 8.2.

alexpott’s picture

Status: Patch (to be ported) » Fixed

Committed 52ecc26 and pushed to 8.2.x. Thanks!

  • alexpott committed 52ecc26 on 8.2.x
    Issue #2791727 by bhide.nishad, chishah92, tresti88, Chi: Wrong links in...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.