Feature #11867

Wrong typeNum is not detected

Added by Philipp Gampe over 2 years ago. Updated about 1 year ago.

Status:On Hold Start date:2011-01-04
Priority:Should have Due date:
Assignee:- % Done:

0%

Category:-
Target version:Core - 6.0.0
TYPO3 Version:4.7 Tags:
PHP Version: Complexity:
Votes: 0

Description

You can pass the typeNum (&type=xxx) with <link uid,type>Text</link>. This is not catched at all. At least it is not broken.

Not sure how to easily solve this ... maybe create real link after all other test passed and check with external link checker? Otherwise we would need pull up TS parser, get the values and check if those are set - but still it might not be working. Just pulling up typolink, get the URL and be done by accessing as external URL might be easier.

bug_11867.diff (6.3 kB) Michael Miousse, 2011-01-11 18:54

bug_11867_v2.diff (6.7 kB) Michael Miousse, 2011-01-12 15:35

bug_11867_v3.diff (6.6 kB) Michael Miousse, 2011-01-12 19:57

History

Updated by Michael Miousse over 2 years ago

I'm not for the suggestion of of parsing it with the external url parser.
It would mean that every single internal link would be parsed and would majorly slow the process.

We better check the ts it is shorter then a http request

Updated by Patrick Gaumond over 2 years ago

  • Status changed from New to Needs Feedback

Updated by Michael Miousse over 2 years ago

Here is a patch to fix the issue

Updated by Philipp Gampe over 2 years ago

great to see a patch ... I will take a deeper look the next days (lastest at the bugday).

Updated by Philipp Gampe over 2 years ago

sorry, it does not work... it fails to detect any other typenum.

I set up a link to ?type=1234

and did this in an extension template:

test = PAGE
test.typeNum = 1234
test.10 < page.10

which brings up a the frontend page just fine. But it is reported as broken link :(

Updated by Michael Miousse over 2 years ago

Here is a v2 of the patch
work with <link 1,2 .... and <link 1,0,&type=2
I'll be waiting your feedback

Updated by Philipp Gampe over 2 years ago

I does not work for me :(

I use those links (being on page 73) - disabled RTE

<link 73,98 - internal-link>good typeNum</link>
<link 73,1234 - internal-link>good typeNum</link>
<link 73,666 - internal-link>bad typeNum</link>
<link 73,0 - internal-link>good main page</link>

That shows all links except the last one as failing. But only typeNum 666 is not defined if I check in FE.

Updated by Philipp Gampe over 2 years ago

I debugged now: until line 118 everything seems to be fine. But the condition seems to be always true...

Updated by Philipp Gampe over 2 years ago

now I got it... you did not pass the param $linkParams to the function cheklinks (BTW should be checklinks anyway).

I fixed it in my local copy, but now I get a fatal:

Fatal error: Call to a member function versionOL() on a non-object in home/spieler/t3_playground/t3_trunk/t3lib/class.t3lib_tstemplate.php on line 753

it happens on the second links, even trough $this->rootline is exactly the same.

Updated by Michael Miousse over 2 years ago

sorry i took the wrong file for the patch

error was in this function :
+ function chekTypNum($typeNum) {
+ $response = TRUE;
+ $befunc = t3lib_div::makeInstance('t3lib_BEfunc');
+ $this->rootline =$befunc->BEgetRootLine($linkParams0);
+ if(is_array($this->rootline) && !empty($this->rootline)){
+ $this->tmpl = t3lib_div::makeInstance('t3lib_TStemplate');
+ $this->tmpl->tt_track = FALSE;
+ $this->tmpl->init();
+ $this->tmpl->start($this->rootline);
+ }
+ $this->sPre = $this->tmpl->setup['types.'][$linkParams1];
+ $this->pSetup = $this->tmpl->setup[$this->sPre.'.'];

+ if (!is_array($this->pSetup)) {
+ $response = FALSE;
+ }
+ return $response;
+ }

$linkParams1 should be $typeNum

by the way the check link function create $linkParams from t3lib_div::trimExplode(',',$softRefEntry['matchString']); whitch is pass to the function

Updated by Michael Miousse over 2 years ago

wait now i got the same error as you ill investigate

Updated by Michael Miousse over 2 years ago

no everyting is fine
i was not on a dev version of typo3

the error you point cannot happend at least with the trunk version of TYPO3 the line the error give you is :
if (is_object($GLOBALS['TSFE'])) { // Frontend:
$GLOBALS['TSFE']->sys_page->versionOL('sys_template', $row);
} else { // Backend:
t3lib_BEfunc::workspaceOL('sys_template', $row);
}
since their is a is_object before the call
the error you describe cannot happend

are you working with the trunk version of TYPO3?

Updated by Philipp Gampe over 2 years ago

yes always while testing linkvalidator

Updated by Philipp Gampe over 2 years ago

Hi Michael,

can redo the patch ... I fear it is a complete mess with current trunk now as too much changed.

I also think, we should postpone this to 4.6

Updated by Michael Miousse over 2 years ago

  • Status changed from Needs Feedback to On Hold

Philipp Gampe wrote:

Hi Michael,

can redo the patch ... I fear it is a complete mess with current trunk now as too much changed.

I also think, we should postpone this to 4.6

You are rigth ill redo a patch after the release ill put it on hold until then

Updated by Philipp Gampe over 1 year ago

  • Target version set to 4.7.0
  • TYPO3 Version set to 4.7

Feature --> postponed

Updated by Philipp Gampe about 1 year ago

  • Target version changed from 4.7.0 to 6.0.0

Also available in: Atom PDF