weixin_39989159
weixin_39989159
2020-12-02 11:40

Ezp 23753 node alias translation

JIRA: https://jira.ez.no/browse/EZP-23753

Problem: When a node that exists on a language different from the siteaccess default language, but has a translated parent/path, the UrlAlias will be incorrect. For example, for a "FreFolder/EnArticle" the returned alias in fre siteaccess is "EnFolder/EnArticle". Besides incorrect, this causes additional problems when there is a PathPrefix setting for that SA.

This happens because eZContentObjectTreeNode requests the alias in the current node's language: eZURLAliasML::fetchPathByActionList( "eznode", $pathArray, $this->CurrentLanguage );

The fix from EZP-20494 (PR #572) resolved this by prefering the wanted language ONLY for the last node, and returning the rest of the path according to the prioritized languages, however it introduced a change in behavior as well.

This PR resolves the problem by reverting 20494 (if applicable), and having the node fetch the alias full path using solely the prioritized language list.

该提问来源于开源项目:ezsystems/ezpublish-legacy

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

11条回答

  • weixin_39786617 weixin_39786617 4月前

    :warning: _WARNING: URLAlias Pull request detected, extra reviews and testing needed! ping :hand:

    点赞 评论 复制链接分享
  • weixin_39862847 weixin_39862847 4月前

    WTF :) ?

    点赞 评论 复制链接分享
  • weixin_39573512 weixin_39573512 4月前

    You're drunk , go home ;-)

    点赞 评论 复制链接分享
  • weixin_39699070 weixin_39699070 4月前

    :P ;)

    点赞 评论 复制链接分享
  • weixin_39989159 weixin_39989159 4月前

    Updated PR, added regression test. The logic was modified a bit, essentially nodes's CurrentLanguage is only set when the node was fetched on a specific language (and the actual translation matches).

    This means that fetching f.e. from templates as described in EZP-17632 will still return the alias in that language, but fetching with default will always respect prioritized languages.

    点赞 评论 复制链接分享
  • weixin_39977776 weixin_39977776 4月前

    +1

    点赞 评论 复制链接分享
  • weixin_39989159 weixin_39989159 4月前

    gentle ping :)

    点赞 评论 复制链接分享
  • weixin_39862847 weixin_39862847 4月前

    going 's style on this one : +0,5

    点赞 评论 复制链接分享
  • weixin_39573512 weixin_39573512 4月前

    Nitpicking aside: +1.

    点赞 评论 复制链接分享
  • weixin_39699070 weixin_39699070 4月前

    With BD's nitpicking, +0,5 :)

    点赞 评论 复制链接分享
  • weixin_39862847 weixin_39862847 4月前

    ping , you can merge it

    点赞 评论 复制链接分享