Project

General

Profile

Actions

Bug #82798

closed

Linkhandler for records works only when BE user is logged in

Added by Markus Dübbert about 7 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Site Handling, Site Sets & Routing
Target version:
Start date:
2017-10-18
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

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


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #87574: Redirects to records (linkHandler) don't workClosed2019-01-29

Actions
Actions #1

Updated by Markus Dübbert about 7 years ago

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

Actions #2

Updated by Georg Ringer about 7 years ago

  • Status changed from New to Closed
Actions #3

Updated by Benjamin Robinson over 5 years ago

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?

Actions #4

Updated by Benjamin Robinson over 5 years ago

  • Related to Bug #87574: Redirects to records (linkHandler) don't work added
Actions #5

Updated by Tina Westner over 3 years ago

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.)

Actions #6

Updated by Oliver Bartsch over 3 years ago

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?

Actions #7

Updated by Tina Westner over 3 years ago

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.

Actions

Also available in: Atom PDF