Add this code somewhere in a system plugin:
$document = JFactory::getDocument();
$document->addHeadLink('/mysite/site-map', 'next', 'rel');
$document->addHeadLink('/mysite/site-map', 'contents', 'rel');
The resulting HTML should contain multiple links to /mysite/site-map (ít is not only allowed but also very legitimate case):
<link href="/mysite/site-map" rel="next"/>
<link href="/mysite/site-map" rel="contents"/>
Resulting HTML contains only the link added at last:
<link href="/mysite/site-map" rel="contents"/>
PHP Built On Linux 2.6.32-504.8.1.el6.i686 #1 SMP Wed Jan 28 18:25:26 UTC 2015 i686
Database Version 5.1.73
Database Collation utf8_general_ci
PHP Version 5.3.3
Web Server Apache/2.2.15 (CentOS)
WebServer to PHP Interface apache2handler
Joomla! Version Joomla! 2.5.11 Stable [ Ember ] 26-April-2013 14:00 GMT
Joomla! Platform Version Joomla Platform 11.4.0 Stable [ Brian Kernighan ] 03-Jan-2012 00:00 GMT
This behaviour (introduced in 2.5) leads to unpredictable results in HTML head, especially when addHeadLink is called from different places (extensions, plugins). The reason, why JDocumentHTML must store the links in a map by HREF, is beyond my comprehension. The unique key for head links should be (if any) HREF+REL.
You are reporting a bug in Joomla! 2.5.11 ???
This version is exceedingly old and has been updated many times to 2.5.28
Since December 2014 Joomla 2.5 is no longer supported at all.
Priority | Urgent | ⇒ | Medium |
Status | New | ⇒ | Information Required |
Labels |
Added:
?
|
Closing this issue because it's about the no longer supported Joomla 2.5.
If that issue still exists in 3.x, feel free to reopen the issue or create a new one.
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-02-18 07:45:10 |
If you would care about your project you would - instead of practicing tracker bureaucracy - look into code base (libraries/joomla/document/html/html.php JDocumentHTML::addHeadLink) and see that this error persists as well in release 2.5.28 as in 3.3.6. Who are you, IRS?
Title |
|
Title |
|
Yes, Bakual, I would like to reopen the issue... How? I can edit but can't change status?
I am re-opening this issue as it has now been stated that it is present in a supported release
(It is because we care that we don't and can't waste time on reports of issues in unsupported versions)
Status | Closed | ⇒ | New |
Closed_Date | 2015-02-18 07:45:10 | ⇒ |
@dimamizou Do you want to create a PR to solve this? You seem to know the code a bit.
There is a doc which explains how to do it using the GitHub UI: https://docs.joomla.org/Using_the_Github_UI_to_Make_Pull_Requests
I'm not sure yet how this could be changed without breaking backward compatibility.
I think it is a bug and the behaviour isn't expected as it is now.
The method is here: https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/document/html/html.php#L277
I agree it is wrong currently.
But if you look at where and how the (public!) $this->_links
property is used, I don't see how we can change how it is stored without breaking stuff in other places and 3rd parties.
FYI, we use this method in languagefilter without any issue (so far)
https://github.com/joomla/joomla-cms/blob/staging/plugins/system/languagefilter/languagefilter.php#L625
@infograf768 problem will come when try to use same link more than once, with different rel
if I right understand
Labels |
Added:
?
|
Oh yes, it will break almost all templates, they often change this array with accessing it directly. This is done because you can't set it to an empty array and work from there. So I think we can only change it with the next major version. So in the meantime people they like to have the same href as link with different rel tag need to copy the file to a different location.
Labels |
Removed:
?
|
Closing as this issue have the Re-evaluate for v4.0 label
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-07-16 11:36:40 |
Closed_By | ⇒ | zero-24 |
Milestone |
Added: |
Milestone |
Added: |
I don't know why, but this fancy editor swallowed the half of my text in Expected result and Actual result although preview displayed everything ok. It must have been some "special chars" or whatsoever.
I must say: I don't have time to learn another freaking Wiki markup! Link "Markup Help" here or use TEXTAREA!
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6117.