1
votes

I managed to make news (tx_news) work realurl under the default language. Then I wanted to localize the news, so I created transaltions for them. However when I access the list view for a non-default language, it fails with

Request parameters could not be validated (&cHash comparison failed)

The failing link does not contain cHash, it looks like this

http://host.com/mysite/en/about-us/

What could be the cause and how to fix it? Here is the realURL setup

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']=array (
  '_DEFAULT' => 
  array (
    'init' => 
    array (
      'enableCHashCache' => true,
      'enableCHashCache' => 1,
      'respectSimulateStaticURLs' => 0,
      'appendMissingSlash' => 'ifNotFile,redirect',
      //'adminJumpToBackend' => true,
      'enableUrlDecodeCache' => true,
      'enableUrlEncodeCache' => true,
      'emptyUrlReturnValue' => '/mysite/',
    ),
    'pagePath' => 
    array (
      'type' => 'user',
      'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
      'spaceCharacter' => '-',
      'languageGetVar' => 'L',
      'rootpage_id' => '1',
      'firstHitPathCache'=> '1',
    ),
    'preVars' => 
    array (
      0 => 
      array (
        'GETvar' => 'L',
        'valueMap' => 
        array (
          'cs' => '1',
        ),
        'noMatch' => 'bypass',
      ),
    ),
    'fixedPostVars' => array(
        '19' => array(
        array(
            'GETvar' => 'tx_news_pi1[controller]',
            'noMatch' => 'bypass',
        ),
        array(
            'GETvar' => 'tx_news_pi1[action]',
            'noMatch' => 'bypass',
        ),
        array(
            'GETvar' => 'tx_news_pi1[news]',
            'lookUpTable' => array(
                'table' =>
            'tx_news_domain_model_news',
            'id_field' => 'uid',
            'alias_field' => 'title',
            'addWhereClause' => ' AND NOT deleted',
            'useUniqueCache' => 1,
            'useUniqueCache_conf' => array(
                'strtolower' => 1,
                'spaceCharacter' => '-',
            ),
            'enable404forInvalidAlias' => '1',
            'languageGetVar' => 'L',
            'languageExceptionUids' => '',
            'languageField' => 'sys_language_uid',
            'transOrigPointerField' => 'l10n_parent',
        ),
      ),
    ),
    ),

    ),

);
4
Just a word of advice, don't use CMS if you are building a custom app. I have found that making a CMS yield to your will is a lot harder than just building from scratch. CMS are good for simple sites; but if you are trying to build something with some advanced functionality, you should just build from scratch. - user1477388
I totally disagree to build anything from scratch, especially if you are working alone. One man can not implement security like TYPO3 security team, or Symfony, or Zend. There is no need to invent wheel, unless it is a better wheel :) and one man can hardly do it on his own. - smitrovic

4 Answers

12
votes

With this error I had fight a lot.

Go to Typo3 Install Tool => All configuration and change the value 1 => 0 for this attribute.

[FE] [pageNotFoundOnCHashError] = 0

I hope this gona solve the problem !!!

2
votes

I seem to have fixed it by emptying the tx_realurl_chashcache in the database.

1
votes

I had to disable caching for the page. On my site it seems the "no_cache" parameter is confusing the chash calculation. This way i can keep the - i think important - security setting [FE][pageNotFoundOnCHashError] = 0

1
votes

In Typo3 8.x version:

click the "Speaking Urls" module in the backend and than do "Flush all entries"

Now when you browse the frontend those entries would get re-created. And every thing should work fine.

Basically here we are deleting all page path entries for all pages so that they get created again.

Also you may delete the entries for the selected page by selecting the option "Delete all entries for this page"