Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assume you've tested this - because right now I'm extra confused on code review about the difference between this line and the line below on 145. As a result not sure if this belongs here or in that querySelector section :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldnt work it out either. did it all by trial and error
from what I could tell when we dont have an active tab defined on load the code here just added "active"
we have code elsewhere that puts ariahidden on everything
It is only removed when you have a real active tab hence this code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW these lines till
this.hasActive = true;are a fallback in case the backend throws some markup without any tab active. The lines starting from 142 also are referring to the links and the lines before to the tab content, so it's a sync danceThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it always opens without an active tab unless one has been saved in the session and a tab with that name exists or the url included the #tab fragment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC there is some code that sets the active attribute in one of the 2 relative layouts. Maybe there's a bug there. Normally the active tab should be set in the backend, the code for the hash or the localsorage should be applied after this part as it's a client related code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think there can be or this section of the js would never have been needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is: https://github.com/joomla/joomla-cms/blob/6bffa56d6eab72555d941ff59a908ce9e377b7e2/libraries/cms/html/uitab.php#L87
The fallback is there because there should always be a fallback. Also I think that this parts reverts the active tab form the hash, if I read the code correctly (eg no active code from the backend but hash in the url => the hash will not be respected, order of execution)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I already see the bug:
JHtmlUiTabthat will not compute it needs to beHTMLHepleror better__METHOD__as few lines aboveUh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__METHOD__won't work as we need it to check for thestartTabSetmethod - not theaddTabmethod. We'd need to use__CLASS__i guessThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
joomla/joomla-cms#28179 PR - but I don't think this will fix it -
__METHOD__will still use theJHtmlUiTabclass I think as it's not namespaced yet. But it's good practice to use__CLASS__anyhow as we will need to namespace at some point. If it fixes it all the better