- last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago Custom Commands Failed - π©πͺGermany FeyP
I'm not convinced that the API change proposed in #7 is in scope here. Adding such a method would constitute a b/c break and would delay this bug fix until Drupal 11, which I don't think is reasonable. If we want to add such a method, this could easily be done in a separate issue later.
Attached are updated patches for Drupal 10.1.x-dev and an interdiff with #6. I renamed the test class to MenuUiContentTranslationTest so that other integration tests with content_language could be added there in the future, if needed. I also replaced the two test methods with a data provider. The rest of the changes in the test file are for code that was deprecated in Drupal 8 or Drupal 9.
- last update
over 1 year ago 29,379 pass, 2 fail - last update
over 1 year ago 29,381 pass The last submitted patch, 16: 2904899-16-tests-only.patch, failed testing. View results β
- Status changed to Needs work
over 1 year ago 10:13pm 12 May 2023 - πΊπΈUnited States smustgrave
Can the issue summary be updated. to include proposed solution.
Also the steps were written for D8 are they still the same for D10? Fine if they are just want to double check.
- Status changed to Needs review
over 1 year ago 8:34am 13 May 2023 - π©πͺGermany FeyP
Thanks once more for your review @smustgrave!
The steps to reproduce still apply for the latest 10.1.x-dev, which is also confirmed by the new test coverage. I still did a new manual test following the STR in the IS and updated the core version, a few UI strings that changed slightly since 8.4.x and also updated the stack trace in the actual result. I also updated the IS with the missing info from the current issue summary template including a proposed resolution.
- Status changed to RTBC
over 1 year ago 5:43pm 15 May 2023 - πΊπΈUnited States smustgrave
Thanks! That made it much more clear and was able to replicate.
Patch fixes the issue.
- last update
over 1 year ago 29,389 pass, 2 fail The last submitted patch, 16: 2904899-16.patch, failed testing. View results β
- πΊπΈUnited States smustgrave
Meant to cleanup tags.
Also random failure.
- last update
over 1 year ago 29,388 pass, 4 fail The last submitted patch, 16: 2904899-16.patch, failed testing. View results β
- last update
over 1 year ago 29,390 pass - π©πͺGermany FeyP
Random test failure, see π [random test failure] InstallerExistingConfig[SyncDirectory]MultilingualTest::testConfigSync Fixed , retest was green. Back to RTBC per #20.
- last update
over 1 year ago 29,390 pass - last update
over 1 year ago 29,390 pass 3:44 1:44 Running- last update
over 1 year ago 29,401 pass - last update
over 1 year ago 29,401 pass - last update
over 1 year ago 29,402 pass - last update
over 1 year ago 29,411 pass - Open on Drupal.org βEnvironment: PHP 8.1 & MySQL 5.7last update
over 1 year ago Waiting for branch to pass - last update
over 1 year ago 29,420 pass - last update
over 1 year ago 29,422 pass - last update
over 1 year ago 29,422 pass 18:44 15:40 Running- last update
over 1 year ago Build Successful - last update
over 1 year ago 29,432 pass - last update
over 1 year ago 29,432 pass - last update
over 1 year ago 29,438 pass - last update
over 1 year ago 29,438 pass - last update
over 1 year ago 29,438 pass - last update
over 1 year ago 29,443 pass - last update
over 1 year ago 29,446 pass - last update
over 1 year ago 29,445 pass - last update
over 1 year ago 29,445 pass - last update
over 1 year ago 29,441 pass - last update
over 1 year ago 29,441 pass - last update
over 1 year ago 29,441 pass - last update
over 1 year ago 29,446 pass - last update
over 1 year ago 29,446 pass 3:43 0:04 Running- last update
over 1 year ago 29,448 pass - last update
over 1 year ago 29,448 pass - last update
over 1 year ago 29,448 pass - last update
over 1 year ago 29,452 pass - last update
over 1 year ago 29,455 pass - last update
over 1 year ago 29,456 pass - last update
over 1 year ago 29,457 pass - last update
over 1 year ago 29,458 pass - last update
over 1 year ago 29,459 pass - last update
over 1 year ago 29,460 pass - last update
over 1 year ago 29,461 pass - Status changed to Needs work
over 1 year ago 4:43am 8 August 2023 - π³πΏNew Zealand quietone
Doing RTBC triage. Thank you all for an up to date Issue Summary, it truly helps.
Reading the proposed resolution I wonder why this just being applied when saving a menu_link in the UI. Surely this can be done outside of the UI? And thus things will break? Am I not understanding something?
I think a followup is needed for #7, but as always, search first. Adding tag.
I do not see any comments here explaining what was done for a code review. And it is still listed as a remaining task.
Setting to NW because of my question above.
- Status changed to Needs review
over 1 year ago 5:32am 8 August 2023 - π©πͺGermany FeyP
Reading the proposed resolution I wonder why this just being applied when saving a menu_link in the UI. Surely this can be done outside of the UI? And thus things will break? Am I not understanding something?
This is not an API issue. The issue is the way the Menu UI module uses the API to update a menu link. It tries to create a translation when it shouldn't. I tried to rephrase the proposed resolution so that this is hopefully more clear. Feel free to improve on that.
I think a followup is needed for #7, but as always, search first. Adding tag.
Filed β¨ Add an API method to LanguageInterface to simply checking, if a language is a pseudo language Closed: works as designed . If this needs to be postponed against a Drupal 11 meta or any tags or something, I'd appreciate your guidance.
Didn't do the review, so can't comment on that. Back to Needs review.
- Status changed to RTBC
over 1 year ago 4:06pm 9 August 2023 - πΊπΈUnited States smustgrave
Follow up has been filed. Not sure if it should be postponed on this but a user has already started work on it.
#20 did the steps in the IS to verify the issue and the patch solved the issue.
- last update
over 1 year ago 29,461 pass - last update
over 1 year ago 29,467 pass - last update
over 1 year ago 29,467 pass - last update
over 1 year ago 29,467 pass - last update
over 1 year ago 29,467 pass - last update
over 1 year ago 29,471 pass - last update
over 1 year ago 29,471 pass - last update
about 1 year ago 29,471 pass - last update
about 1 year ago 29,471 pass - last update
about 1 year ago 29,471 pass - last update
about 1 year ago 29,472 pass 18:43 14:45 Running- last update
about 1 year ago 29,472 pass - last update
about 1 year ago 29,473 pass - last update
about 1 year ago 29,473 pass - last update
about 1 year ago 29,473 pass - last update
about 1 year ago 29,473 pass - last update
about 1 year ago 29,475 pass - last update
about 1 year ago 29,479 pass - last update
about 1 year ago 29,479 pass - last update
about 1 year ago 29,484 pass - last update
about 1 year ago 29,484 pass - last update
about 1 year ago 29,484 pass - last update
about 1 year ago 29,487 pass - last update
about 1 year ago 29,642 pass - last update
about 1 year ago 29,645 pass - last update
about 1 year ago 29,645 pass - last update
about 1 year ago 29,655 pass - last update
about 1 year ago 29,655 pass - last update
about 1 year ago 29,655 pass - last update
about 1 year ago 29,655 pass - last update
about 1 year ago 29,657 pass - last update
about 1 year ago CI error - last update
about 1 year ago 29,660 pass - last update
about 1 year ago 29,674 pass - last update
about 1 year ago 29,674 pass - last update
about 1 year ago 29,674 pass - last update
about 1 year ago 29,676 pass - last update
about 1 year ago 29,678 pass 18:42 17:33 Running- last update
about 1 year ago 29,680 pass - last update
about 1 year ago 29,680 pass - last update
about 1 year ago 29,680 pass - last update
about 1 year ago 29,680 pass - last update
about 1 year ago 29,680 pass - Status changed to Needs work
about 1 year ago 11:29am 8 November 2023 - π¬π§United Kingdom alexpott πͺπΊπ
+++ b/core/modules/menu_ui/menu_ui.module @@ -95,7 +96,16 @@ function _menu_ui_node_save(NodeInterface $node, array $values) { + if (!in_array($node->language()->getId(), [ + LanguageInterface::LANGCODE_NOT_APPLICABLE, + LanguageInterface::LANGCODE_NOT_SPECIFIED, + ], TRUE)) {
This can be simpler. Looking at \Drupal\Core\Entity\ContentEntityBase::isTranslatable() - we can change this to
if (!$node->language()->isLocked()) {
See
/** * Locked indicates a language used by the system, not an actual language. * * Examples of locked languages are, LANGCODE_NOT_SPECIFIED, und, and * LANGCODE_NOT_APPLICABLE, zxx, which are usually shown in language selects * but hidden in places like the Language configuration and cannot be deleted. * * @var bool */ protected $locked = FALSE;
But I think the following change is even better...
if (!empty($values['entity_id'])) { $entity = MenuLinkContent::load($values['entity_id']); if ($entity->isTranslatable() && $node->isTranslatable()) { if (!$entity->hasTranslation($node->language()->getId())) { $entity = $entity->addTranslation($node->language()->getId(), $entity->toArray()); } else { $entity = $entity->getTranslation($node->language()->getId()); } } else { // Ensure the entity matches the node language. $entity = $entity->getUntranslated(); $entity->set($entity->getEntityType()->getKey('langcode'), $node->language()->getId()); } }
As it is using $node->isTranslatable() so we're a bit more logical. Ie. we say if we can translate this menu link and this node then make the languages match. If not then the menu_link must match the language of the node.
- @feyp opened merge request.
- π©πͺGermany FeyP
Thanks @alexpott for the review.
W/r/t pointing out
LanguageInterface::isLocked()
, I closed the follow-up β¨ Add an API method to LanguageInterface to simply checking, if a language is a pseudo language Closed: works as designed issue as "Works as designed".I agree that the changes you suggested are shorter, more logical and more readable, so I updated the code.
I took the opportunity to switch to an MR based workflow. Added the MR under review to the IS as requested elsewhere by @xjm.
- Status changed to Needs review
about 1 year ago 3:24am 15 November 2023 - π©πͺGermany FeyP
I should have updated the proposed resolution in the IS also, done that now.
- Status changed to RTBC
about 1 year ago 3:13pm 15 November 2023 - πΊπΈUnited States smustgrave
Appears feedback has been addressed
Thanks for updating the issue summary :)
- π¬π§United Kingdom alexpott πͺπΊπ
Committed and pushed ff1090382f0 to 11.x and 91acedade93 to 10.2.x. Thanks!
-
alexpott β
committed ff109038 on 11.x
Issue #2904899 by FeyP, idflood, smustgrave, alexpott: Invalid argument...
-
alexpott β
committed ff109038 on 11.x
- Status changed to Fixed
about 1 year ago 10:27pm 15 November 2023 -
alexpott β
committed 91acedad on 10.2.x
Issue #2904899 by FeyP, idflood, smustgrave, alexpott: Invalid argument...
-
alexpott β
committed 91acedad on 10.2.x
Automatically closed - issue fixed for 2 weeks with no activity.