? Success

User tests: Successful: Unsuccessful:

avatar schnuti
schnuti
29 Nov 2015

modified test : the canonical link should only be added if the site domain parameter is set.
before patch it does the opposite.
see further down for the correct results.

avatar schnuti schnuti - open - 29 Nov 2015
avatar schnuti schnuti - change - 29 Nov 2015
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 29 Nov 2015
Labels Added: ?
avatar schnuti
schnuti - comment - 29 Nov 2015

Reference #8566 Uri not utf8 encoded - base path in Html head bad - cononical link created

avatar infograf768
infograf768 - comment - 29 Nov 2015

Not sure I understand what you want. Whether we use utf8 aliases or not, we always get a canonical because
$link is never equal to '$uri->toString()' or 'rawurldecode($uri->toString()'
After your patch:

With utf8 aliases:
screen shot 2015-11-29 at 18 28 58

Without utf8aliases

screen shot 2015-11-29 at 18 26 34

In this last case we have

<base href="http://localhost:8888/testwindows/trunkgitnew/it/poeti-italiani.html" />
  <meta name="generator" content="Joomla! - Open Source Content Management" />
  <title>Italiano - Poeti italiani</title>
  <link href="/testwindows/trunkgitnew/it/poeti-italiani.html" rel="canonical" />
avatar schnuti
schnuti - comment - 29 Nov 2015

Maybe you should not try with cyrillic characters but with german umlauts or french ones to get the percentencoding more clear. Or where do you get the cyrillic characters?
Well, wich one do you mean is a the correct link to the content you view? It might be that the shorter canonical ones are allowed, but the plugin then adds a canonical link.

If you now add the missing part in the plugin settings it should work. In your case http://localhost:8888. It took mee some time to understand that setting.

The base link is NOT! changed with my patch only the comparison in the plugin.

avatar schnuti
schnuti - comment - 29 Nov 2015

With a "real" server setup with domain name you shouldn't have to add the parameter. It's added with this code.

$domain  = $this->params->get('domain');

if ($domain === null || $domain === '')
{
   $domain = $uri->toString(array('scheme', 'host', 'port'));
}

ie my fix corrects the behaviour for percentencoded aliases in uri's to the same as the ones with "readable" ones. As described above, you do not get canonical links if the the address you entered in your browser is the same as the Joomla router gives you. The "correct" one. The correct one is hopefully better handled by the modified router. In some cases you now get incorrect canonical links from the actual router including ?id=33&.... That's another story.

avatar schnuti
schnuti - comment - 29 Nov 2015

Added very detailed testinstructions above, since the the SEF plugin and the canonical links may not be that wellknown.

avatar infograf768
infograf768 - comment - 30 Nov 2015

I have the feeling you did not understand what I wrote.

A-- I applied your patch above, therefore this is why the urlS do not contain percent-encodings.

B-- What I said was that in ALL cases, even after your patch, we ALWAYS get a canonical when not filling the "Site Domain" param. And that is true whether we use or not utf8 aliases.

If I fill the param with "http://localhost:8888" we get the opposite result, i.e. no canonical, EVEN after your patch.

This is the TIP for the "Site Domain" parameter:
PLG_SEF_DOMAIN_DESCRIPTION="If your site can be accessed through more than one domain enter the canonical one here."

Therefore the issue in the plugin is absolutely not related to the percent-encoding as the canonical is added ONLY when there is NO domain param.

The issue is with null vs false

        if ($domain === null || $domain === '')
        {
            $domain = $uri->toString(array('scheme', 'host', 'port'));
        }

the code is wrong imho. We should replace by

        if ($domain === false || $domain === '')
        {
            $domain = $uri->toString(array('scheme', 'host', 'port'));
        }

If you do that, you will see that percent-encodings or not does not matter. We get a canonical ONLY when the domain param is not empty.
And, best of all, it now gives a correct link (with domain) in the head:

<base href="http://localhost:8888/testwindows/trunkgitnew/po%C3%A8tes-fran%C3%A7ais.html" />
  <meta name="generator" content="Joomla! - Open Source Content Management" />
  <title>Nom de site français - Poètes français</title>
  <link href="http://otherdomain.com/testwindows/trunkgitnew/poètes-français.html" rel="canonical" />

Conclusion: we do have an issue but not the one you target.
I suggest you modify your PR. Otherwise I will make one.

avatar schnuti
schnuti - comment - 30 Nov 2015

Can confirm the bug with the domain. Now it's added when parameter not set.

Can not confirm the rest.
As far as I can see, are you not using the Joomla standard alias. The id's are missing. Why?

avatar mbabker
mbabker - comment - 30 Nov 2015

As far as I can see, are you not using the Joomla standard alias. The id's are missing. Why?

Assigned as a menu item most likely where the ID prefix isn't used.

avatar infograf768
infograf768 - comment - 30 Nov 2015

please change the title of the pr to something like 'wrong canonical link generation' as the issue is not related to utf8 percent-encodings.
I am using standard sef with utf8 alias

avatar infograf768
infograf768 - comment - 30 Nov 2015

btw, i think you have still not understood what's going on.
we now get a correct canonical ONLY when the param is set, otherwise this will not generate a canonical any more.
one more tester.

avatar infograf768 infograf768 - test_item - 30 Nov 2015 - Tested successfully
avatar infograf768
infograf768 - comment - 30 Nov 2015

I have tested this item :white_check_mark: successfully on b6d1e82

wrong canonical generation solved


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8568.

avatar schnuti
schnuti - comment - 30 Nov 2015

@mbabker
Thanks.
I tested with an article assigned to a menu iitem. The same result, Without decoding the cononical link still appears.

@infograf768
Please do not tell me what I understand or not. I'm only trying to explain the results from my testings of the canonical link.

With the second commit the correct actual domain is added to the canonical link, If one is added. And on my testsystem it is, as explained above.

Do what you like with it.

avatar infograf768 infograf768 - change - 30 Nov 2015
The description was changed
Title
SEF plugin, Fix the uri comparison to be utf8 conform
SEF plugin, wrong canonical generation
avatar joomla-cms-bot joomla-cms-bot - change - 30 Nov 2015
Title
SEF plugin, Fix the uri comparison to be utf8 conform
SEF plugin, wrong canonical generation
avatar infograf768
infograf768 - comment - 30 Nov 2015

modified title and test instructions


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8568.

avatar infograf768 infograf768 - change - 30 Nov 2015
The description was changed
avatar fontanil fontanil - test_item - 2 Dec 2015 - Tested successfully
avatar fontanil
fontanil - comment - 2 Dec 2015

I have tested this item :white_check_mark: successfully on b6d1e82

Test OK. Thanks!


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8568.

avatar infograf768 infograf768 - change - 2 Dec 2015
Status Pending Ready to Commit
avatar infograf768
infograf768 - comment - 2 Dec 2015

RTC, can go in 3.5.0 as it is a long standing bug.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8568.

avatar joomla-cms-bot joomla-cms-bot - change - 2 Dec 2015
Labels Added: ?
avatar roland-d roland-d - change - 10 Dec 2015
Milestone Added:
avatar Kubik-Rubik
Kubik-Rubik - comment - 16 Dec 2015

Thank you @schnuti and testers. Merged!

avatar Kubik-Rubik Kubik-Rubik - reference | f14d74f - 16 Dec 15
avatar Kubik-Rubik Kubik-Rubik - merge - 16 Dec 2015
avatar Kubik-Rubik Kubik-Rubik - close - 16 Dec 2015
avatar Kubik-Rubik Kubik-Rubik - close - 16 Dec 2015
avatar joomla-cms-bot joomla-cms-bot - close - 16 Dec 2015
avatar Kubik-Rubik Kubik-Rubik - change - 16 Dec 2015
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2015-12-16 10:18:27
Closed_By Kubik-Rubik
avatar joomla-cms-bot joomla-cms-bot - change - 16 Dec 2015
Labels Removed: ?
avatar jimiero
jimiero - comment - 28 Mar 2016

@infograf768 @Kubik-Rubik I think this is still broken,

Joomla still inserts wrong canonical tags for non-standard joomla extension.

Example install a 3rd party joomla extension and then try to access an url of that extension by placing for example: ?tester=2434 in the end of the url, then view the page source of that url, you will see joomla inserts the ?tester=2434 in the canonical url

avatar infograf768
infograf768 - comment - 28 Mar 2016

@jimiero

This has been corrected again in
#9565

Add a Comment

Login with GitHub to post a comment