Bug #66932

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

Added by Webtech AG about 7 years ago. Updated over 6 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

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

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
#1

Updated by Markus Klein about 7 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?

#2

Updated by Markus Klein about 7 years ago

  • Status changed from New to Needs Feedback

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

#3

Updated by Webtech AG about 7 years ago

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

#4

Updated by Markus Klein about 7 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)

#5

Updated by Webtech AG about 7 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.

#6

Updated by Markus Klein about 7 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.

#7

Updated by Webtech AG about 7 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"?

#8

Updated by Markus Klein about 7 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.

#9

Updated by Webtech AG about 7 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?

#10

Updated by Markus Klein about 7 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"?

#11

Updated by Webtech AG about 7 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!

#12

Updated by Markus Klein about 7 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.

#13

Updated by Webtech AG about 7 years ago

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

#14

Updated by Markus Klein about 7 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.

#15

Updated by Webtech AG about 7 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.

#16

Updated by Benni Mack about 7 years ago

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

Updated by Andreas Wolf about 7 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
#18

Updated by Markus Klein about 7 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.

#19

Updated by Andreas Wolf about 7 years ago

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

#20

Updated by Andreas Wolf about 7 years ago

  • Description updated (diff)
#21

Updated by Gerrit Code Review about 7 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

#22

Updated by Gerrit Code Review almost 7 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

#23

Updated by Susanne Moog almost 7 years ago

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

Updated by Gerrit Code Review almost 7 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

#25

Updated by Gerrit Code Review almost 7 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

#26

Updated by Gerrit Code Review almost 7 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

#27

Updated by Benni Mack almost 7 years ago

  • Target version deleted (7.5)
#28

Updated by Markus Klein over 6 years ago

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

Updated by Andreas Wolf over 6 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.

#30

Updated by Angelo Previtali almost 5 years ago

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

Also available in: Atom PDF