[TYPO3-english] cooluri and tx_news - wrong url for non-localized records

Jan Bednarik info at bednarik.org
Thu Apr 18 08:01:34 CEST 2013


Hi Dirk,

when the lookup fails, the original parameter is returned:

link.Functions.php->lookindb

if (mysql_error() || !$res) return $param;
$row = $db->fetch_row($res);
if (!$row) return $param;

and since '70' (escaped) is returned, it suggests that it's already 
escaped when it comes to this function. I don't see any escaping prior 
to the call in link.Translate.php.

Is it possible that it comes from the extension? Would you be able to 
add some debugging var_dumps or whatever and help me find the cause?

Thanks

Jan

Dne 16.4.2013 12:05, Dirk Wenzel napsal(a):
> Hi,
> Cooluri produces wrong urls for some tx_news records when they aren't
> localized. For instance:
>
> [..]/en/credentials/projects/detail/'70'/
> This url results in an 'page not found' error.
>
> When I perform the DB query manually the result is as expected for both
> languages. It returns the news title in default language (german) for
> non-translated news:
>
> SELECT title
> FROM tx_news_domain_model_news
> WHERE (uid='70' OR l10n_parent='70')
> AND sys_language_uid='0'
>
> SELECT title
> FROM tx_news_domain_model_news
> WHERE (uid='70' OR l10n_parent='70')
> AND sys_language_uid='2'
>
> Any Hints?
>
> CoolUriConf.xml:
> [...]
> <uriparts>
>   <part>
>    <parameter>tx_news_pi1[news]</parameter>
>     <lookindb>
>      <to>SELECT title FROM tx_news_domain_model_news WHERE deleted='0'
> AND hidden='0' AND (uid=$1 OR l10n_parent=$1) AND
> sys_language_uid={L=0}</to>
>      <t3conv>1</t3conv>
>     </lookindb>
>   </part>
>   <part>
>    <parameter>tx_news_pi1[@widget_0][currentPage]</parameter>
>    <t3conv>1</t3conv>
>   </part>
> </uriparts>
>
> <predefinedparts>
>   <part>
>    <parameter>tx_news_pi1[controller]</parameter>
>   </part>
>   <part>
>    <parameter>tx_news_pi1[action]</parameter>
>   </part>
>   <part>
>    <parameter>cHash</parameter>
>    <lookindb>
>     <to>SELECT
> CONCAT(tt1.title,IF(tt2.number>1,CONCAT('-',tt2.number),'')) FROM
> tx_news_domain_model_news as tt1, (SELECT COUNT(*) AS number FROM
> tx_news_domain_model_news WHERE title=(SELECT title FROM
> tx_news_domain_model_news WHERE uid=$1)) AS tt2 WHERE tt1.uid=$1</to>
>    </lookindb>
>   </part>
>   <part>
>    <parameter>no_cache</parameter>
>   </part>
> </predefinedparts>
>
> <valuemaps>
>   <valuemap>
>    <parameter>L</parameter>
>     <!-- L is empty of 0, result is empty -->
>     <value key="">0</value>
>     <!-- L is 2, result is "en" -->
>     <value key="en">2</value>
>     <!-- L is 3, result is empty -->
>     <value key="">3</value>
>   </valuemap>
> </valuemaps>
>
> Kind regards
> Dirk



More information about the TYPO3-english mailing list