- πΊπΈUnited States angrytoast Princeton, NJ
The core issue β¨ Set MenuLinkContent getEntity to public visibility Fixed to expose
\Drupal\menu_link_content\Plugin\Menu\MenuLinkContent::getEntity()
looks like it will finally happen which makes Option 1 the best approach.This is to update the patch to work with the latest 2.x branch code. It also adds a more specific check for
MenuLinkContentInterface
instead of justEntityInterface
because we are looking for a menu link content entity. - πΊπΈUnited States angrytoast Princeton, NJ
After experimenting a bit, it looks like we can further simplify code with a public
MenuLinkContent::getEntity()
. The entity retrieved via the method is already the correct translation, so we can skip theentity.repository
call.Adding an updated patch with the simplified logic.
- Status changed to Needs review
over 1 year ago 4:59am 12 August 2023 - π©πͺGermany Anybody Porta Westfalica
Thank you, that's looking really good! I'm a bit afraid of things breaking, so would be nice to have automated test coverage. Then we can RTBC and merge this with confidence!
And perhaps use a MR instead?
- π·π΄Romania bboty
I've tested #4 https://www.drupal.org/files/issues/2023-07-06/translatable_menu_link_ur... β
and there is an issue. It's calling a protected method "getEntity()" that causes WSOD.
$url = $link->getEntity()->link_override->first();
- πͺπΈSpain eduardo morales alberti Spain, πͺπΊ
Eduardo Morales Alberti β made their first commit to this issueβs fork.
-
jsobiecki β
committed c2a0f1c5 on 2.x
Issue #3252404 by angrytoast, eduardo morales alberti, dmitriy.trt,...
-
jsobiecki β
committed c2a0f1c5 on 2.x
- Status changed to Fixed
12 days ago 8:45pm 11 November 2024 - π΅π±Poland jsobiecki Wroclaw
I really like this change! The code looks much simpler and the fact that we reduced SQL queries number of site is very important.
I share concern of @Anybody, that we may fall into some of regressions and unit tests can help reduce that risk. But I'd create a initial unit (rather kernel) test as separate tasks. This module was designed as quick and simple workaround in D8 times and I wanted to keep it that way. As we have D11 and it's still helpful, it's good idea to improve its quality. But not now, I'll do that as separate issue.
I did some small refactor of code, as patch failed to apply and did manual testing. I was no able to "break" module after this modification.