- 🇫🇷France mefianf
A small patch update for 10.3.x, as it seems they are not the same.
- 🇪🇸Spain fjgarlin
Yeah, setting "8.3-ubuntu" fixes the issue for _TARGET_PHP. The MR does the same fix, but in a "cleaner" way, keeping _TARGET_PHP to just a PHP version, instead of having a weird suffix.
I think I'm going to set it again as "Needs review" as this is the best fix with what we have so far.
The Needs Review Queue Bot → tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide → to find step-by-step guides for working with issues.
- @dieterholvoet opened merge request.
- 🇧🇪Belgium DieterHolvoet Brussels
It seems like adding menu_name to the context array is the best realistic solution at the moment. I rebased the patch against 11.x and injected the current route match as dependency.
- First commit to issue fork.
I answer to myself. finally i've solved my issue by fixing 2 points:
The first point was a mistake from my side : the "value" used in the definition must be a "string". In my code, i used an entity reference id defined as an integer.
The second point was linked to my select field defined as a "multiple" one. To address this point it's necessery to alter the "compare" function of core/misc/states.js. I add this js library into my module
/** * @file * Extends core/misc/states.js. */ (function($) { //correction core : can't add a #states on a select with multiple = true function _compareCustom(a, b) { if (a !== "undefined" && typeof b === 'object' && b instanceof Array) { if (b.includes(a)) { return true; } } if (a === b) { return typeof a === 'undefined' ? a : true; } return typeof a === 'undefined' || typeof b === 'undefined'; } //hack : surcharge function compare from core/states.js to use _compareCustom instead of _compare2 Drupal.states.Dependent.prototype.compare = function compare(reference, selector, state) { var value = this.values[selector][state.name]; if (reference.constructor.name in Drupal.states.Dependent.comparisons) { return Drupal.states.Dependent.comparisons[reference.constructor.name](reference, value); } return _compareCustom(reference, value); }; })(jQuery);
This solution works with all drupal version from 8.x to 10.3.1.
Sorry, but the last version of Drupal 10.3.1 break all my "select" based conditional fields.
My conditional fields works well on Drupal 10.2.6Here an extract from my form where the field_child is visible when the taxonomy term (tid:1234) is selected
$form['field_child']['#states'] = [ 'visible' => [ ['select[name="field_parent[]"]' => '1234', ], ];
- 🇮🇳India Manthan.Chauhan
I have reroll patch no 126 as per drupal version 10.3.1.
- 🇺🇸United States steyep
I could not get the patch in #74 nor the diff from the MR to apply cleanly in 10.3. I've attached a re-rolled the patch for 10.3
- 🇳🇱Netherlands bbrala Netherlands
🐛 Browser language detection is not cache aware Needs work has been updated to use a responsesubscriber that allows setting Vary headers. Wonder if those changes also need partial split into this issue?
- 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
Committed to 11.x
Per https://www.drupal.org/about/core/policies/core-change-policies/allowed-... → this isn't eligible for backport to 11.0.x.
Glad to see this one resolved.
-
larowlan →
committed 6a685718 on 11.x
Issue #2329253 by tstoeckler, Bhanu951, hchonov, golddragon007,...
-
larowlan →
committed 6a685718 on 11.x
The Needs Review Queue Bot → tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide → to find step-by-step guides for working with issues.