FriendsOfTYPO3 / frontend_editing

TYPO3 CMS Frontend Editing
https://friendsoftypo3.github.io/frontend_editing/
102 stars 38 forks source link

Unable to follow urls to news detail pages which are generated by realurl #307

Closed cdaecke closed 5 years ago

cdaecke commented 5 years ago

As soon as I enable ext:realurl I am not able to follow links to detail pages of ext:news records anymore. A link "news/this-is-a-news-record/" won't show me the detail page of the news, but the overview page.

Working: index.php?id=2&tx_news_pi1[news]=1&tx_news_pi1[controller]=News&tx_news_pi1[action]=detail&cHash=53fb7c436dc9db781655adfa123dffa3

Not working: news/this-is-a-news-record/

Here is my news part of the realURL config:

'fixedPostVars' => array(

  'newsDetailConfiguration' => array(
    array(
      'GETvar' => 'tx_news_pi1[action]',
      'valueMap' => array(
        'detail' => '',
      ),
      'noMatch' => 'bypass'
    ),
    array(
      'GETvar' => 'tx_news_pi1[controller]',
      'valueMap' => array(
        'News' => '',
      ),
      'noMatch' => 'bypass'
    ),
    array(
      'GETvar' => 'tx_news_pi1[news]',
      'lookUpTable' => array(
        'table' => 'tx_news_domain_model_news',
        'id_field' => 'uid',
        'alias_field' => 'IF(path_segment!="",path_segment,title)',
        'addWhereClause' => ' AND NOT deleted',
        'languageGetVar' => 'L',
        'languageExceptionUids' => '',
        'languageField' => 'sys_language_uid',
        'transOrigPointerField' => 'l10n_parent',
        'expireDays' => 180,
        'enable404forInvalidAlias' => true,
        'useUniqueCache' => 1,
        'useUniqueCache_conf' => array(
          'strtolower' => 1,
          'spaceCharacter' => '-'
        ),
      )
    )
  ),

  '2' => 'newsDetailConfiguration',
)

TYPO3 8.7.19 frontend_editing 1.4.0

mabolek commented 5 years ago

@cdaecke I'm unable to reproduce this issue. Are you still experiencing this with the latest frontend_editing and TYPO3 8.7?

cdaecke commented 5 years ago

@mabolek Yes, this issue still exists.

I updated my system. Now I am using the following: TYPO3: 8.7.24 frontend_editing: 1.4.6 news: 7.0.8

Tested on Mac Firefox, Safari, Chrome.

I did some more research on this issue: I can see, that the iframe is loaded with following data:

<iframe src="http://domain.com/news/this-is-a-news-record/?frontend_editing=true&amp;no_cache=1" border="0" frameborder="0"></iframe>

When I put this url in my browser, it will load the news list (which would be http://domain.com/news/) and not the news detail page. As soon, as I remove the frontend_editing=true it is working. So this seems more or less a realUrl problem?

Any idea, how to handle this?

cdaecke commented 5 years ago

After some more investigation on this issue, I found out, that somehow my realUrl config is the bad guy regarding this topic. When I change the valueMap for 'GETvar' => 'tx_news_pi1[action]' from 'detail' => '' to '' => 'detail' and for 'GETvar' => 'tx_news_pi1[controller]' from 'News' => '' to '' => 'News' everything is working, but my url looks ugly (it is now /news///this-is-a-news-record/ instead of /news/this-is-a-news-record/).

Working example:

'fixedPostVars' => array(

    'newsDetailConfiguration' => array(
      array(
          'GETvar' => 'tx_news_pi1[action]',
          'valueMap' => array(
              '' => 'detail',
          ),
          'noMatch' => 'bypass'
      ),
      array(
          'GETvar' => 'tx_news_pi1[controller]',
          'valueMap' => array(
              '' => 'News',
          ),
          'noMatch' => 'bypass'
      ),
      array(
          'GETvar' => 'tx_news_pi1[news]',
          'lookUpTable' => array(
              'table' => 'tx_news_domain_model_news',
              'id_field' => 'uid',
              'alias_field' => 'IF(path_segment!="",path_segment,title)',
              'addWhereClause' => ' AND NOT deleted',
              'languageGetVar' => 'L',
              'languageExceptionUids' => '',
              'languageField' => 'sys_language_uid',
              'transOrigPointerField' => 'l10n_parent',
              'expireDays' => 180,
              'enable404forInvalidAlias' => true,
              'useUniqueCache' => 1,
              'useUniqueCache_conf' => array(
                  'strtolower' => 1,
                  'spaceCharacter' => '-'
              ),
          )
        )
    ),

),

@mabolek I close this issue, but if someone has an idea how to handle this, every hint is very appreciated.