Project

General

Profile

Actions

Bug #88506

closed

Scheduler generated URLs contain absolute unix paths

Added by Nils Vindice almost 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
scheduler
Target version:
-
Start date:
2019-06-06
Due date:
% Done:

0%

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

Description

I use Typo3 v8 with the Aimeos shop extension, which uses \TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder for URL generation. When using the scheduler like recommended by Typo3 docs:

*/15 * * * * /usr/local/bin/php /home/user/www/typo3/sysext/core/bin/typo3 scheduler:run

all URLs generated contain the absolute unix path, eg: https://mypage.com*/home/user/www/typo3/htdocs/*product/....

When switching to the typo3 directory and calling cli_dispatcher from there directly, eg:

 * * * * * cd /home/user/www/typo3 && ./cli_dispatcher.phpsh scheduler

all URLs are created correctly. Same when calling the scheduler manually from the backend.

IMHO, all scheduler calls should return the same results.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #72706: Manually instantiated UriBuilder is incompleteClosed2016-01-14

Actions
Actions #1

Updated by Aimeos no-lastname-given almost 5 years ago

The code for initializing the frontend to be able to generate the URLs is the same, regardless which script is used:

if( !is_object( $GLOBALS['TT'] ) )
{
    $GLOBALS['TT'] = GeneralUtility::makeInstance( 'TYPO3\CMS\Core\TimeTracker\TimeTracker' );
    $GLOBALS['TT']->start();
}
$page = GeneralUtility::makeInstance( 'TYPO3\CMS\Frontend\Page\PageRepository' );
$page->init( true );
$name = 'TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController';
$GLOBALS['TSFE'] = GeneralUtility::makeInstance( $name,  $GLOBALS['TYPO3_CONF_VARS'], $pageid, 0 );
$GLOBALS['TSFE']->connectToDB();
$GLOBALS['TSFE']->initFEuser();
$GLOBALS['TSFE']->no_cache = true;
$GLOBALS['TSFE']->sys_page = $page;
$GLOBALS['TSFE']->rootLine = $page->getRootLine( $pageid );
$GLOBALS['TSFE']->determineId();
$GLOBALS['TSFE']->initTemplate();
$GLOBALS['TSFE']->getConfigArray();
$rootline = BackendUtility::BEgetRootLine( $pageid );
$_SERVER['HTTP_HOST'] = BackendUtility::firstDomainRecord( $rootline );
GeneralUtility::flushInternalRuntimeCaches();

IMHO, TYPO3 should offer a way to generate URLs in CLI tasks by default.

Actions #2

Updated by Benni Mack over 4 years ago

  • Related to Bug #72706: Manually instantiated UriBuilder is incomplete added
Actions #3

Updated by Benni Mack over 4 years ago

  • Status changed from New to Closed

Starting with TYPO3 v9, Site Handling does support creating proper links through the PageRouter API. See the linked ticket for a code snippet on how to do this. I will close this issue, as we can continue discussing this in the other issue.

Actions

Also available in: Atom PDF