Project

General

Profile

Actions

Bug #66932

closed

Shortcut Mode "First subpage of selected/current page" doesn't work in multilanguage site

Added by Webtech AG over 9 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Frontend
Target version:
Start date:
2015-06-17
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
TYPO3 Version:
6.2
PHP Version:
5.5
Tags:
Complexity:
hard
Is Regression:
No
Sprint Focus:

Description

If you have a multilanguage website with shortcuts in an HMENU and they are of shortcut mode "First subpage of selected/current page", then the links (a-tags) will only be generated in standard language, not other language.

A workaround is to set shortcut Mode "Selected page".

A testset for this issue and the two subissues is available in the .t3d file attached to this ticket.


Files

menu-structur.jpg (112 KB) menu-structur.jpg Webtech AG, 2015-05-21 16:09
66932.t3d (6.02 KB) 66932.t3d Andreas Wolf, 2015-06-17 16:17

Subtasks 2 (0 open2 closed)

Bug #67562: Page type is not taken into account for translation overlaysClosedAndreas Wolf2015-06-17

Actions
Bug #67563: Broken shortcut generates empty <a> tag in menuClosedAndreas Wolf2015-06-17

Actions

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Feature #68300: Get a list of pages based on page uids from the page repositoryClosedPatrick Broens2015-07-17

Actions
Related to TYPO3 Core - Bug #81920: Disabling Shortcut Mode "First subpage of selected/current page" doesn't work in multilanguage siteClosed2017-07-19

Actions
Actions #1

Updated by Markus Klein over 9 years ago

  • Target version deleted (next-patchlevel)
  • Complexity deleted (medium)
  • Is Regression changed from Yes to No

Which TYPO3 version are you using exactly? Latest 6.2.12?

Actions #2

Updated by Markus Klein over 9 years ago

  • Status changed from New to Needs Feedback

I can't reproduce the issue on current 6.2 branch.

Actions #3

Updated by Webtech AG over 9 years ago

Yes I was using 6.2.12, which I upgrade from 4.5.37 to 6.2.12 .

Actions #4

Updated by Markus Klein over 9 years ago

Can you please provide more details on your setup?

How does your page tree look like?
What does the HMENU TS look like?
What is the setup of the default page and its translation?
Did you select "First subpage" in both languages? (maybe post a screenshot of the page properties)

Actions #5

Updated by Webtech AG over 9 years ago

- Did you select "First subpage" in both languages? (maybe post a screenshot of the page properties)
This gave me the hint to check page properties in second language. So I saw, that I only set "First subpage" in default language. Then I set it also in second language and it works.

Conclusion: In V4.5.x it has different behaviour. In V6.2.x you have to set "First subpage" in every languages page properties. Is that right?

If you needany further information, so let me know.

Actions #6

Updated by Markus Klein over 9 years ago

This is rather a bugfix. You can define the type of the shortcut per language.
If you need it to be inherited in the translation, change the TCA to avoid the overlaying.

Actions #7

Updated by Webtech AG over 9 years ago

Do you mean the configuration field [FE][pageOverlayFields]?
At the moment value is set as follows: uid,title,subtitle,nav_title,media,keywords,description,abstract,author,author_email,url,urltype,shortcut,shortcut_mode

I don't get it. Do I have to remove or let the value for "shortcut,shortcut_mode"?

Actions #8

Updated by Markus Klein over 9 years ago

That would be one option too. By removing the fields from the pageOverlayFields you prevent those fields from being taken into account when translating a page.
Still the Backend will show the fields in the Alternative Page Language records, so you need to hide them there as well for user convenience.
You can hide those fields via page TSconfig.

My TCA suggestion above was a mistake, since the pages table has separated translations in a different table, so just ignore that please.

Actions #9

Updated by Webtech AG over 9 years ago

Ok I see. To explain you the real problem, we have to move some steps backward :-).

- How does your page tree look like?
For example. Shortcut from "Das Gebiet" to first subpage "Zuständigkeitsgebiet" only works in default language (with shortcut-mode = first subpage)
See attached file menu-structur.jpg

- What does the HMENU TS look like?

10.marks.MENU = HMENU
10.marks.MENU {
       special = directory
       special.value = 5
       entryLevel = 1
       1 = TMENU
       1 {
              noBlur = 1
              # Zeile welche ganze Navigation umschliesst
              wrap = <ul>|</ul>
              NO = 1
              NO {
                       ATagTitle.field = abstract // description // title
                       #wrapItemAndSub = <li>|</li>
                       wrapItemAndSub = <li class="first">|</li>|*|<li>|</li>
               }
               CUR < .NO
               CUR.ATagParams = class ="active" 
               ACT < .NO
               ACT.ATagParams = class ="active" 
       }
}

- What is the setup of the default page and its translation?
What do mean with setup? Page TS of "Das Gebiet" or Site TS (Template)?

- Did you select "First subpage" in both languages?
No, only in default language!

I hope you can reproduce this behaviour I have wit 6.2.12?

Actions #10

Updated by Markus Klein over 9 years ago

Is the "shortcut target" field empty on the "Das Gebiet" page?

What did you select/configure for the shortcut in the translation of "Das Gebiet"?

Actions #11

Updated by Webtech AG over 9 years ago

- Is the "shortcut target" field empty on the "Das Gebiet" page?
Yes, it is empty.

- What did you select/configure for the shortcut in the translation of "Das Gebiet"?
Type = Standard (not shortcut).

What I just found out is in the translation, that with Type = Standard there is a direct dependency with "Shortcut Mode". If it is "Selected Page", which is normally set, then it doesn't work. If it is "First subpage of selected/current page" then it works. Even, if after all, Type = Standard is set!

Actions #12

Updated by Markus Klein over 9 years ago

  • Category set to Frontend
  • Status changed from Needs Feedback to Accepted
  • Assignee set to Markus Klein
  • Priority changed from Should have to Must have
  • Target version set to 6.2.13
  • Complexity set to hard
  • Sprint Focus set to Stabilization Sprint

I'm able to reproduce this now!

Summary

2 Languages

Pagetree:

Page 1
- Page 2

Page 1 is of type shortcut to first subpage in the default language
Page 1 is of type Standard in the translation

Depending on the shortcut_mode of the translation - which is a hidden field - the rendering of the menu item is broken.
In case the hidden shortcut_mode is
  • "selected page" an empty a-tag is rendered
  • "first subpage" a shortcut to the first subpage is rendered

Both are wrong.

Expected

If the page type of the translation is "Standard", then a normal link to the page in the translated language has to be generated.

Actions #13

Updated by Webtech AG over 9 years ago

That's good to know. Thanks a lot for your effort!

Actions #14

Updated by Markus Klein over 9 years ago

  • Target version changed from 6.2.13 to 7.3 (Packages)

I took a deep look into the code now and found some not so nice details.

Currently the menu generation works like this:
  • fetch all pages
  • version overlay
  • other stuff
  • check for shortcut
  • language overlay

We have the situation that the shortcut is evaluated on the default language instead of doing this on the translation.
That happens in \TYPO3\CMS\Frontend\Page\PageRepository::getMenu().
Of course the menu content objects also do some further checks for shortcuts, but now work on the data coming from the translation(!) which might not even be of type shortcut and might contain any weird data in the shortcut* DB fields.
The chaos is perfect.

The solution would be to switch the last two processing steps and do the language overlay first. This would be a breaking change for many sites, which now work with the current behaviour. We therefore have no chance to fix this for 6.2, sorry.

We will fix that for 7 LTS though as a breaking change.

Actions #15

Updated by Webtech AG over 9 years ago

Ok - I see that it would be a big change to fix it in TYPO3 V6.2.x languages architecture. If you will fix it in V7.x than it will be fine.

Due to the fact that there is a work around I can live with it in V6.2.x.

Thank you for your clarification and information.

Actions #16

Updated by Benni Mack over 9 years ago

  • Target version changed from 7.3 (Packages) to 7.4 (Backend)
  • Sprint Focus deleted (Stabilization Sprint)
Actions #17

Updated by Andreas Wolf over 9 years ago

I tried to get to the root cause of this problem and found out that there are actually a few separate problems that come together here:

  1. as Markus described, the shortcut is evaluated too early. This is easy to fix
  2. if a shortcut page (in the original language) is a non-shortcut page in a translation, the shortcut will still be evaluated. Reason for this is that the doktype is not used on translation overlay, as it is not included in TYPO3_CONF_VARS[FE][pageOverlayFields], therefore, the translated page is still treated as a shortcut
    • in this case, an empty link is generated in the menu. This can also be fixed by setting doNotLinkIt inside the menu generation process (I have a patch for that)
  3. shortcut mode "selected page" in the original language, no page selected: page disappears, even in translation (because it is filtered by menu generation) -> fixed with the fix for #1
  4. the shortcut mode is reset when the page is translated. This happens because of the way the record is instantiated when creating the translation from the page module. I’d have to dig in again to check how we can change this
Actions #18

Updated by Markus Klein over 9 years ago

@Wolf:

1.) yes easy to fix, but very breaking
2.) is a consequence of 1. (even if doktype is part of pageOverlayFields you still evaluating different records for the same page while creating the menu)

IMO changing 1.) - hence ensuring that the menu is generated only from the translated records and data is not messed with default record - solves all the issues.

Actions #19

Updated by Andreas Wolf over 9 years ago

I created a T3D file to test this issue, see the attachment. Instructions are on "Homepage 0" in language 0.

Actions #20

Updated by Andreas Wolf over 9 years ago

  • Description updated (diff)
Actions #21

Updated by Gerrit Code Review over 9 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40363

Actions #22

Updated by Gerrit Code Review over 9 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40363

Actions #23

Updated by Susanne Moog over 9 years ago

  • Target version changed from 7.4 (Backend) to 7.5
Actions #24

Updated by Gerrit Code Review over 9 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40363

Actions #25

Updated by Gerrit Code Review over 9 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40363

Actions #26

Updated by Gerrit Code Review over 9 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40363

Actions #27

Updated by Benni Mack about 9 years ago

  • Target version deleted (7.5)
Actions #28

Updated by Markus Klein almost 9 years ago

  • Assignee changed from Markus Klein to Andreas Wolf
  • Target version set to 8 LTS
Actions #29

Updated by Andreas Wolf over 8 years ago

  • Status changed from Under Review to Closed

This was fixed for 7.6 and 8 with another (feature) patch. We won’t fix it for 6.2 as the behaviour change might break old sites.

Actions #30

Updated by Angelo Previtali over 7 years ago

  • Related to Bug #81920: Disabling Shortcut Mode "First subpage of selected/current page" doesn't work in multilanguage site added
Actions

Also available in: Atom PDF