Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic TYPO3 v9 LTS compatibility #654

Open
wants to merge 13 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Classes/Encoder/UrlEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ protected function createAliasForValue($getVarValue, array $configuration) {
}

$maxAliasLengthLength = isset($configuration['maxLength']) ? (int)$configuration['maxLength'] : self::MAX_ALIAS_LENGTH;
$aliasValue = $this->tsfe->csConvObj->substr('utf-8', $row[$configuration['alias_field']], 0, $maxAliasLengthLength);
$aliasValue = mb_substr($row[$configuration['alias_field']], 0, $maxAliasLengthLength);

# Do not allow aliases to be empty (see issue #1)
if (empty($aliasValue)) {
Expand Down
14 changes: 12 additions & 2 deletions Classes/ViewHelpers/LanguageFromIdViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,23 @@ class LanguageFromIdViewHelper extends AbstractViewHelper {

static protected $languageCache = array();

/**
* Initialize view helper arguments
*/
public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('language', 'string', '', true);
}

/**
* Obtains language title from its id.
*
* @param string $language
* @return string
*/
public function render($language) {
public function render() {
$language = $this->arguments['language'];

if ($language == 0) {
$result = $GLOBALS['LANG']->sL('LLL:EXT:realurl/Resources/Private/Language/locallang.xlf:viewhelper.languageFromId.defaultLanguage');
}
Expand Down
17 changes: 14 additions & 3 deletions Classes/ViewHelpers/SetVariableViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,25 @@
*/
class SetVariableViewHelper extends AbstractViewHelper {

/**
* Initialize view helper arguments
*/
public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('name', 'string', '', true);
$this->registerArgument('value', 'string', '', false, null);
}

/**
* Set (override) the variable in $name.
*
* @param string $name
* @param mixed $value
* @return void
*/
public function render($name, $value = NULL) {
public function render() {
$name = $this->arguments['name'];
$value = $this->arguments['value'];

if ($value === NULL) {
$value = $this->renderChildren();
}
Expand Down
14 changes: 11 additions & 3 deletions Classes/ViewHelpers/TranslateToJsonViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,22 @@ class TranslateToJsonViewHelper extends AbstractViewHelper {
*/
protected $escapeOutput = FALSE;

/**
* Initialize view helper arguments
*/
public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('key', 'string', 'Translation Key', true);
}

/**
* Renders the translation and encodes to json string.
*
* @param string $key Translation Key
* @return string The translated key or tag body if key doesn't exist
*/
public function render($key) {
$result = LocalizationUtility::translate($key, 'realurl');
public function render() {
$result = LocalizationUtility::translate($this->arguments['key'], 'realurl');

return json_encode($result);
}
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Layouts/Backend.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
1: '{f:uri.resource(path:\'realurl_be.css\')}'
}" includeJsFiles="{
2: '{f:uri.resource(path:\'realurl_be.js\')}'
}" loadJQuery="1"/>
}" />
<div class="typo3-fullDoc">
<div id="typo3-docheader">
<div class="typo3-docheader-functions">
Expand Down
4 changes: 2 additions & 2 deletions Resources/Private/Templates/Overview/Index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ <h2><f:translate key="LLL:EXT:realurl/Resources/Private/Language/locallang.xlf:m
<p><f:translate key="LLL:EXT:realurl/Resources/Private/Language/locallang.xlf:module.aliases.intro"/></p>
<f:if condition="{isCompatibleCacheImplementation}">
<h2><f:translate key="LLL:EXT:realurl/Resources/Private/Language/locallang.xlf:module.url_cache"/></h2>
<p><f:format.raw><f:translate key="LLL:EXT:realurl/Resources/Private/Language/locallang.xlf:module.url_cache.intro" htmlEscape="false"/></f:format.raw></p>
<p><f:format.raw><f:translate key="LLL:EXT:realurl/Resources/Private/Language/locallang.xlf:module.url_cache.intro" /></f:format.raw></p>
<h2><f:translate key="LLL:EXT:realurl/Resources/Private/Language/locallang.xlf:module.path_cache"/></h2>
<p><f:format.raw><f:translate key="LLL:EXT:realurl/Resources/Private/Language/locallang.xlf:module.path_cache.intro" htmlEscape="false"/></f:format.raw></p>
<p><f:format.raw><f:translate key="LLL:EXT:realurl/Resources/Private/Language/locallang.xlf:module.path_cache.intro" /></f:format.raw></p>
</f:if>
<f:comment>
<h2><f:translate key="LLL:EXT:realurl/Resources/Private/Language/locallang.xlf:module.configuration"/></h2>
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Templates/PathCache/Index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<f:section name="content">
<h1><f:translate key="LLL:EXT:realurl/Resources/Private/Language/locallang.xlf:module.path_cache"/></h1>
<p><f:format.raw><f:translate key="LLL:EXT:realurl/Resources/Private/Language/locallang.xlf:module.path_cache.intro" htmlEscape="false"/></f:format.raw></p>
<p><f:format.raw><f:translate key="LLL:EXT:realurl/Resources/Private/Language/locallang.xlf:module.path_cache.intro" /></f:format.raw></p>

<f:flashMessages/>

Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Templates/UrlCache/Index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<f:section name="content">
<h1><f:translate key="LLL:EXT:realurl/Resources/Private/Language/locallang.xlf:module.url_cache"/></h1>
<p><f:format.raw><f:translate key="LLL:EXT:realurl/Resources/Private/Language/locallang.xlf:module.url_cache.intro" htmlEscape="false"/></f:format.raw></p>
<p><f:format.raw><f:translate key="LLL:EXT:realurl/Resources/Private/Language/locallang.xlf:module.url_cache.intro" /></f:format.raw></p>

<f:flashMessages/>

Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@
"typo3-ter/realurl": "self.version"
},
"require": {
"typo3/cms-core": ">=6.2.0,<9.0.0",
"typo3/cms-core": ">=6.2.0,<10.0.0",
"php": ">=5.4.0,<7.3.0",
"ext-mbstring": "*"
},
"require-dev": {
"phpunit/phpunit": "~4.8.0"
},
"suggest": {
"typo3-ter/static-info-tables": ">=6.2.0"
"typo3-ter/static-info-tables": ">=6.2.0",
"friendsoftypo3/typo3db-legacy": "~1.0.0"
},
"autoload": {
"psr-4": {
Expand Down
7 changes: 4 additions & 3 deletions ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
array (
'depends' =>
array (
'typo3' => '6.2.0-8.9.999',
'typo3' => '6.2.0-9.9.999',
'php' => '5.4.0-7.2.999',
'scheduler' => '6.2.0-8.9.999',
'scheduler' => '6.2.0-9.5.999',
),
'conflicts' =>
array (
Expand All @@ -37,10 +37,11 @@
'suggests' =>
array (
'static_info_tables' => '6.2.0-',
'typo3db_legacy' => '1.0.0-1.0.99',
),
),
'comment' => 'Stability improvements. More functions are available for hook developers.',
'user' => 'dmitry',
);

?>
?>
4 changes: 2 additions & 2 deletions ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ function includeRealurlConfiguration() {
$realurlConfigurationFile = trim($configuration['configFile']);
if ($realurlConfigurationFile && @file_exists(PATH_site . $realurlConfigurationFile)) {
/** @noinspection PhpIncludeInspection */
\TYPO3\CMS\Core\Utility\GeneralUtility::requireOnce(PATH_site . $realurlConfigurationFile);
require_once(PATH_site . $realurlConfigurationFile);
}
elseif ($configuration['enableAutoConf'] && file_exists(PATH_site . TX_REALURL_AUTOCONF_FILE)) {
/** @noinspection PhpIncludeInspection */
\TYPO3\CMS\Core\Utility\GeneralUtility::requireOnce(PATH_site . TX_REALURL_AUTOCONF_FILE);
require_once(PATH_site . TX_REALURL_AUTOCONF_FILE);
}

if (is_array($existingConfiguration)) {
Expand Down