-
-
Save beelbrecht/4692685 to your computer and use it in GitHub Desktop.
<f:render section="Main" /> |
{namespace v=Tx_Vhs_ViewHelpers} | |
<!DOCTYPE html> | |
<html lang="de"> | |
<head> | |
<meta charset="utf-8"/> | |
<title>TYPO3 Template</title> | |
</head> | |
<body> | |
<f:layout name="Default" /> | |
<f:section name="Main"> | |
<v:page.content.render /> | |
</f:section> | |
</body> | |
</html> |
page.10 = FLUIDTEMPLATE | |
page.10 { | |
file = EXT:website_template/Resources/Private/Templates/Site/Index.html | |
layoutRootPath = EXT:website_template/Resources/Private/Templates/Site/Layouts/ | |
partialRootPath = EXT:website_template/Resources/Private/Templates/Site/Partials/ | |
} |
Ok, after a bit debugging I've found this problem:
$pid = $GLOBALS['TSFE']->id;
if (isset($this->arguments['pageUid']) === TRUE) {
$pid = $this->arguments['pageUid'];
} elseif ($GLOBALS['TSFE']->page['content_from_pid']) {
$pid = $GLOBALS['TSFE']->page['content_from_pid'];
}
var_dump($pid);
exit;
this results in "null";
the $pid is empty.
the pid in the where condition looks like this: pid = ''
It's a plain 4.5 installation, no mountpoints, no "use content from other page..."
Okay, that leads me to suspect that using isset() on the ArrayAccess implementation that is $this->arguments on 4.5 will always return TRUE or at the very least, return TRUE incorrectly in this specific case. On 4.6+ this is an array.
If you change this to:
if (isset($this->arguments['pageUid']) === TRUE && $this->arguments['pageUid'] > 0) {
Does it then work as it should? This fix would allow the existing behaviour on all versions of TYPO3 so I hope it also solves this particular issue on 4.5 :)
Output of var_dump($this->arguments)
object(Tx_Fluid_Core_ViewHelper_Arguments)[137]
protected 'arguments' =>
array (size=11)
'column' => int 0
'limit' => null
'order' => string 'sorting' (length=7)
'sortDirection' => string 'ASC' (length=3)
'pageUid' => null
'contentUids' => null
'slide' => int 0
'slideCollect' => int 0
'slideCollectReverse' => int 0
'loadRegister' => null
'as' => null
BUT output of "isset($this->arguments['pageUid'])" gives me a TRUE
I think, that this is the problem...
- great minds think alike ;)
yeah! It works!
Big thanks for your support :-)
You're very welcome. Anytime :)
Hope you enjoy your weekend. And VHS!
/C
Hmm, something just reminded me that there could be some detail in the default values of VH arguments on 4.5 - could you try this instead:
That way should make perfectly sure the query is correct even if the default value is misunderstood.