-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change _getHtml to append class rather than overwrite for children #12862
Conversation
@jonshipman thank you for the pull request. Could you sign the CLA and then we can start to progress this pull request. |
I give my consent, the CLA button says I sign it but this PR doesn't seem to update. Attached is the image I see. |
@jonshipman it seems that the account the commit is assigned to (https://github.com/jonshipmansmc) is different from the account you are creating the pr and signing the CLA with (https://github.com/jonshipman). If you change the author or the commit and repush the branch it should pick up the changes and cla signing. |
933c80a
to
ed7fcf0
Compare
ed7fcf0
to
862e74a
Compare
Signed. |
@@ -235,7 +235,13 @@ protected function _getHtml( | |||
|
|||
if ($childLevel == 0 && $outermostClass) { | |||
$outermostClassCode = ' class="' . $outermostClass . '" '; | |||
$child->setClass($outermostClass); | |||
$current_class = $child->getClass(); |
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.
could you update this variable to be $currentClass
dfbd873
to
7c02acb
Compare
Change _getHtml to append class rather than overwrite for children
Description
When creating a dependency injection for the Magento\Theme\Block\Html\Topmenu class, we are unable to change class names on children in a beforeGetHtml method because the protected method _getHtml declares setClass() on all children items. What this contribution changes is checking each child for an existing class and appends the $outermostClass if true.
Manual testing scenarios
Contribution checklist