Bug #82798
Linkhandler for records works only when BE user is logged in
Added by Markus Dübbert over 4 years ago.
Updated about 1 year ago.
Category:
Link Handling, Site Handling & Routing
Description
when i use the linkhandler for my news records as described here:
https://usetypo3.com/linkhandler.html
the link only works while a BE user is logged in. After log out the link disappears.
Page TsConfig:
TCEMAIN.linkHandler.tx_news {
handler = TYPO3\CMS\Recordlist\LinkHandler\RecordLinkHandler
label = News
configuration {
table = tx_news_domain_model_news
storagePid = 20
hidePageTree = 1
}
scanAfter = page
}
Typoscript:
config.recordLinks.tx_news {
typolink {
parameter = 4
additionalParams.data = field:uid
additionalParams.wrap = &tx_news_pi1[news]=|
useCacheHash = 1
}
}
TYPO 8.7.8
news 6.1.1
it seems to be a difference where the page tsconfig is embedded.
if the page tsconfig is embedded in the root page it works.
if it is embedded in an extension, it doesn't.
we can close this issue
- Status changed from New to Closed
It should also be possible to use the linkhandler if TsConfig is initialized via ext_tables.php in a site-extension like ...
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="DIR:EXT:user_site/Configuration/TsConfig/Page">');
... or ...
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerPageTSConfigFile(
'user_site',
'Configuration/TSconfig/Page/PageDefaults.tsconfig',
'My PageDefaults.tsconfig'
);
This does not work in 9.5.4 if the fe-page cache is generated by someone whithout BE-login.
It does work if the file is included in the root pages TSconfig (page properties):
<INCLUDE_TYPOSCRIPT: source="DIR:EXT:user_site/Configuration/TsConfig/Page">
Can we reopen this issue?
- Related to Bug #87574: Redirects to records (linkHandler) don't work added
I think, this issue is still existing in 10.4.15.
Linkhandler is configured correctly in PageTSConfig and TypoScript.
When I include the Linkhandler-PageTSConfig via ext_tables.php, then:
--> Clearing Cache --> Calling the page with existing be-login --> the linkhandler-links are generated and fe-cache is written fine, too.
--> Clearing Cache --> Calling the page without existing be-login first --> the linkhandler-links are not there (text, but not linked) and this version is in fe-cache as well.
When I include the Linkhandler-PageTSConfig via Pagetree, then
-> in both cases the links are generated and the fe-cache is written correctly.
(The reason for including via ext_tables.php was, that I need the linkhandler-options in redirect-module. For the moment I include the config twice, so both problems are solved.)
Hi Tina, do you use ExtensionManagementUtility->addPageTSConfig()
for including the Page TSconfig? If so, please move this into your ext_localconf.php
. This way it works for me without problems. Also have a look at the corresponding PHPDoc of addPageTSConfig
which states:
* Adds $content to the default Page TSconfig as set in $GLOBALS['TYPO3_CONF_VARS'][BE]['defaultPageTSconfig']
* Prefixed with a [GLOBAL] line
* FOR USE IN ext_localconf.php FILE
In case you are using ExtensionManagementUtility::registerPageTSConfigFile
, this must go into Configuration/TCA/Overrides/pages.php
. This possibility however also works for me in both ways (ext_tables.php
and pages.php
).
Is there something else to take into consideration?
Hi Oli,
thank you for pointing me in the right direction. I read of ext_tables.php in some tickets and did not think about it, just tried. But that was wrong, of course.
Everything works now after putting the line in ext_localconf.php
thank you.
Also available in: Atom
PDF