Bug #25317
closedTypolink fails to link between two non-default page types
0%
Description
If you try to link from a page type with typeNum != 0 to another page type using typolink the parameter notation pageId,typeNum described in tsref (http://typo3.org/documentation/document-library/core-documentation/doc_core_tsref/4.3.2/view/1/5/#id2507605), the link will contain the current type as well.
Steps to reproduce:
Take an environment with three different page types (e.g. default (type=0), print version (type=98), plaintext (type=42)).
Create a text contet element containing three link-tags (assuming pageID=23):
<LINK 23,0>test normal</LINK>
<LINK 23,98>test print</LINK>
<LINK 23,42>test plaintext</LINK>
Now, if you take a look on the output of the plaintext type, the generated links will look as follows:
http://example.com/index.php?id=23&type=98&type=42
Addionally, type=0 won't be considered at all.
Solution:
t3lib_tstemplate::linkData should consider type parameter during "uniqueLinkVars"-Handling
Additionally, $typeNum should not be considered as a boolean variable. It should be checked, whethere is $typeNum contains an integer or not.
Improvement: After exploding the link parameters, it should be checked whether type is explicitiy set to "0". If the parameters contain type=0, the type parameter can be left out.
Proposed patch appended. Problem seems to affect all TYPO3 Versions
(issue imported from #M17937)
Files
Updated by Ernesto Baschny over 13 years ago
- Category changed from Communication to Frontend
- Status changed from New to Closed
- Target version deleted (
0)
Problem was the use of "config.linkVars = type", which is not expected by typoLink.
Maybe we should simply document that the user shouldn't include "type" in linkVars, as the type is inherited anyway (or can be changed by a specific typoLink parameter).
Requested to document in http://wiki.typo3.org/Pending_Documentation#doc_core_tsref_.284.5.29