Closed fgalinski closed 8 years ago
Hi Dmitry,
I created a patch for your extension, which allows that the return value of a user functions is NULL. This can be necessary if your URL segment doesn't always exists.
diff --git a/typo3conf/ext/realurl/class.tx_realurl.php b/typo3conf/ext/realurl/class.tx_realurl.php index d44d06c..8be35e9 100644 --- a/typo3conf/ext/realurl/class.tx_realurl.php +++ b/typo3conf/ext/realurl/class.tx_realurl.php @@ -653,8 +653,12 @@ class tx_realurl extends tx_realurl_baseclass { ); $prevVal = $GETvarVal; $GETvarVal = $this->apiWrapper->callUserFunction($setup['userFunc'], $params, $this); - $pathParts[] = rawurlencode($GETvarVal); - $this->cHashParameters[$GETvar] = $prevVal; + if ($GETvarVal === NULL) { + $this->rebuildCHash |= $parameterSet; + } else { + $pathParts[] = rawurlencode($GETvarVal); + $this->cHashParameters[$GETvar] = $prevVal; + } } elseif (is_array($setup['lookUpTable'])) { $prevVal = $GETvarVal; $GETvarVal = $this->lookUpTranslation($setup['lookUpTable'], $GETvarVal); @@ -1615,6 +1619,10 @@ class tx_realurl extends tx_realurl_baseclass { 'setup' => $setup ); $value = $this->apiWrapper->callUserFunction($setup['userFunc'], $params, $this); + if ($value === NULL) { + array_unshift($pathParts, $origValue); + break; + } } elseif (is_array($setup['lookUpTable'])) { $temp = $value; $value = $this->lookUpTranslation($setup['lookUpTable'], $value, TRUE);
I hope you will integrate this patch :)
Kind regards, Fabian
Realurl 1.x is no longer supported or updated. Please, switch to realurl 2.
Thanks for your fast reply! We will check the new version as soon as possible. :)
Closed because applies to unsupported version.
Hi Dmitry,
I created a patch for your extension, which allows that the return value of a user functions is NULL. This can be necessary if your URL segment doesn't always exists.
I hope you will integrate this patch :)
Kind regards, Fabian