User tests: Successful: Unsuccessful:
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.
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
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:
Without utf8aliases
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" />
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.
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.
Added very detailed testinstructions above, since the the SEF plugin and the canonical links may not be that wellknown.
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.
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?
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.
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
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.
I have tested this item successfully on b6d1e82
wrong canonical generation solved
@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.
Title |
|
Title |
|
modified title and test instructions
I have tested this item successfully on b6d1e82
Test OK. Thanks!
Status | Pending | ⇒ | Ready to Commit |
RTC, can go in 3.5.0 as it is a long standing bug.
Labels |
Added:
?
|
Milestone |
Added: |
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-12-16 10:18:27 |
Closed_By | ⇒ | Kubik-Rubik |
Labels |
Removed:
?
|
@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
Reference #8566 Uri not utf8 encoded - base path in Html head bad - cononical link created