[TYPO3-mvc] UriBuilder: Setting linkAccessRestrictedPages to FALSE has no effect

Franz Koch typo3.RemoveForMessage at elements-net.de
Tue Jun 14 14:02:26 CEST 2011


Hey Christine,

> I am trying to build a link to a page using UriBuilder. If the user does not
> have access to this page, I would like NO link to be generated.
>
> UriBuilder::setLinkAccessRestrictedPages() seems to be exactly for this
> case. However, setting this to FALSE does not seem to have an effect: the
> link is still generated.
>
> It seems that the reason for this is that inside
> UriBuilder's buildTypolinkConfiguration() method, it has:
>
> if ($this->linkAccessRestrictedPages === TRUE) {
>   $typolinkConfiguration['linkAccessRestrictedPages'] = 1;
> }
>
> So the typolink config only changes if this property is true. If it's false,
> I guess it uses some default typolink configuration.. which in my case seems
> to be that this is already true (and I'd like to keep its current behavior,
> in general). But so, I can't set it to false for this case.
>
> This is a bug right? Has anyone had this problem? I'll raise an issue in the
> bugtracker if so...

I just had a look at the according part in the TYPO3 source and you're 
right, it has to be possible to explicitly set this value to FALSE, so 
I'd say this is a bug. Please add a ticket and most preferably also a 
patch or best a push request on gerrit :)

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list