- Issue created by @tunic
- Status changed to Needs review
12 months ago 2:37pm 20 December 2023 - Status changed to Needs work
12 months ago 5:50pm 20 December 2023 - Status changed to Needs review
12 months ago 7:53pm 20 December 2023 - 🇪🇸Spain tunic Madrid
We could add a test but I'm not sure if we should. The issue is a missing conditional safeguard to avoid using an empty array as it is not empty. I'm not convinced we should add a new test to core, adding a few seconds to each test run, for this simple issue.
This is the original code:
if (options && options.dependent_selectors) { Object.keys(options.dependent_selectors).forEach((field) => { $fields = $context.find(`input[name^="${field}"]`); const dependentColumns = options.dependent_selectors[field]; $fields.on('change', fieldsChangeHandler($fields, dependentColumns)); Drupal.behaviors.contentTranslationDependentOptions.check( $fields, dependentColumns, );
$fields is passed to Drupal.behaviors.contentTranslationDependentOptions.check but it is empty.
I've uploaded a video with the issue, showing the problem in Simplytestme and the fix applying the patch.
Of course, we can still add a test, but I would say we should test JS is not broken in the /admin/config/regional/content-language page. That would be a more general test. Not sure if this is the proper place, it could be better to use this issue to add it.
- Status changed to Needs work
11 months ago 12:01am 2 January 2024 - 🇺🇸United States smustgrave
Sorry for the delay.
I think a generic javascript test should be fine. I believe WebDriverTestBase has an ability to test for console errors. Is that what you meant at least in the last sentence?
- 🇪🇸Spain tunic Madrid
The test was trickier than expected. I needed to install the standard profile to get a failing test. Enabling content translation or the minimal profile was not enough. I guess the problem are the entities created.
This is the "Content language and translation" page (/admin/config/regional/content-language) with the standard profile:
And this enabling only the content translation module:
- Status changed to Needs review
11 months ago 1:06pm 2 January 2024 - 🇪🇸Spain tunic Madrid
As expected test passes but the "Test-only" job fails, demonstrating the issue.
See https://git.drupalcode.org/issue/drupal-3410011/-/pipelines/70540
- Status changed to RTBC
11 months ago 2:26pm 2 January 2024 - 🇺🇸United States smustgrave
Good work on the test! Did confirm the browser error following those steps, and that MR fixed it.
- last update
11 months ago Build Successful - last update
11 months ago CI aborted - 🇪🇸Spain tunic Madrid
#10, I think the problem you are pointing it is a different issue. If I apply that patch to 10.2 without the fix in the MR the error described in this issue are still present.
I would say a new issue has to be created.
I think I was not clear enough, sorry.
That patch is to use in addition to the fix in this very issue. As it is already part of 10.2.2,
I simply added this patch to fix the wrong if-clause (mentioned in #10) that was only brought by this very issue here:
https://git.drupalcode.org/issue/drupal-3410011/-/commit/cd9fed87f0568d9...I checked deeper and it seems that issue was created here.
https://www.drupal.org/project/drupal/issues/3238849 📌 Refactor (if feasible) use of jquery is function to use vanillaJS FixedOne of those commits it only part of the fork for 3410011 – I guess that I mixed that up.
- 🇪🇸Spain tunic Madrid
Yes, the commit of the error you mention was introduced in the MR of this issue when a rebase was done, adding all commits committed the dev branch.
So we are good here, and still RTBC-
- Status changed to Needs work
10 months ago 6:38am 19 February 2024 - 🇳🇿New Zealand quietone
I'm triaging RTBC issues → . I read the IS, the comments and the MR. I didn't find any unanswered questions.
\This is a nice wee fix and with a test!
However, setting to NW for the test to use the testing profile. This is because we have working to reduce the usages of our resources. I expect the tests in the content_translation module can help with this.
📌 [meta] Convert remaining tests using Standard profile to use Testing profile instead Fixed
- Status changed to Closed: duplicate
9 months ago 8:23pm 9 March 2024 - 🇩🇪Germany sleitner
I think this is a duplicate of 🐛 Javascript warning from content language and translation page Fixed . It is fixed in 10.3.x-dev