- Issue created by @braintec
- ๐ฏ๐ดJordan ahmad abbad Jordan
Ahmad Abbad โ made their first commit to this issueโs fork.
- Merge request !21Issue #3409221: ui_patterns_settings.module - array_unshift() โ (Open) created by ahmad abbad
- ๐ฏ๐ดJordan ahmad abbad Jordan
The hook_form_field_storage_config_edit_form_alter() is deprecated and should be replaced by hook_form_field_config_edit_form_alter().
- Status changed to Needs review
about 1 year ago 7:14am 17 December 2023 - ๐ฎ๐นItaly braintec Perugia, Umbria
I tried testing the fork ui_patterns_settings-3409221 and encountered this issue. After updating Drupal from 10.1.7 to 10.2 and replacing ui_patterns_settings with the proposed fork, the problem shifts to the core and returns the error: 'InvalidArgumentException: The configuration property settings.allowed_values.0.label.0 doesn't exist.' in Drupal\Core\Config\Schema\ArrayElement->get() (line 76 of core/lib/Drupal/Core/Config/Schema/ArrayElement.php). Installing Drupal 10.2 from scratch and using the fork instead of the official release doesn't change anything, or rather, the module doesn't throw an error, but the core does. It seems that someone else has reported this issue with the core.
- ๐บ๐ธUnited States kerrymick Chicago
I tested the fork as a patch on 10.2 and it fixed the issue for me.
- ๐ซ๐ทFrance steveoriol Grenoble ๐ซ๐ท
It's worked for me too
Add inside "patches" section on composer.json files :
[...] "drupal/ui_patterns_settings":{ "[3409221] ui_patterns_settings.module - array_unshift()": "https://git.drupalcode.org/project/ui_patterns_settings/-/merge_requests/21.patch" }, [...]
- Status changed to RTBC
12 months ago 11:58am 30 December 2023 - ๐ณ๐ฑNetherlands ekes
Works, but it the hook_ should be ui_patterns_settings_ rather than ui_patterns_ as that's this module's name (rather than the one it depends on).
- ๐บ๐ธUnited States thejimbirch Cape Cod, Massachusetts
Another +1 for RTBC
- ๐ซ๐ฎFinland kekkis Pirkkala
Changing the hook from the one used in <=10.1 to one only present in 10.2+ is probably unwise, if the goal of this module is to support core versions other than latest stable. @Ahmad Abbad, can you specify in more detail how the deprecation causes the actual error? Deprecated methods and functions (and hooks) are just that, deprecations; they should not break anything but should work as reminders that a new implementation is needed in the longer run.
- Status changed to Needs work
11 months ago 9:09am 22 January 2024 - ๐ซ๐ฎFinland kekkis Pirkkala
I have to take back my takeback. In Drupal 10.1 and below, the field configuration form and the field storage configuration form were two separate forms. In Drupal 10.2, the forms have been combined into one. Changing the hook this way would break the module when used with Drupal 10.1 (or below). If I'm reading the code correctly, changing the hook this way (from using form id
field_storage_config_edit_form
to using form idfield_config_edit_form
) would make the alterations move from the field storage config form to the field config form which is an entirely different thing in D10.1 and below. So then basically the submit function added in the hook,ui_patterns_settings_form_field_storage_config_edit_form_submit
, will run on the field config rather than field storage config, meaning that the stored configuration would change, and most probably would not work correctly in other parts of the module anymore.Based on the above I'm setting this back to Needs work. A solution should be found that works both on Drupal 10.1 and Drupal 10.2, at the very least, based on the project page's statement of supported major versions.
- ๐บ๐ธUnited States thejimbirch Cape Cod, Massachusetts
Drupal 10.1 EOL is slated for the Week of June 17, 2024.
- ๐ฌ๐งUnited Kingdom catch
If the new hook implementation is only needed on Drupal 10.2, and the old hook implementation is only needed on Drupal 10.1, then including them both, but returning early based on comparing against Drupal::VERSION, should work.
- ๐ซ๐ทFrance Grimreaper France ๐ซ๐ท
Hi,
Uploading patch for Composer usage.
This error prevents adding field on content entity types with Field UI on Core 10.2.
- First commit to issue fork.
- First commit to issue fork.
- Status changed to Needs review
10 months ago 3:15pm 28 February 2024 - ๐ญ๐บHungary huzooka Hungary ๐ญ๐บ๐ช๐บ
- Restored the original hook for Drupal versions lower than 10.2.0
- Added helper which determines whether we need the new hook or not
- Renamed the original hook to
_ui_patterns_field_form_alter
, and aligned it a bit so it can work both on the old storage form and also on the new, combined form
Adding a traditional patch.
- last update
10 months ago Composer require-dev failure - last update
10 months ago 3 pass - last update
10 months ago Composer require-dev failure - last update
10 months ago 3 pass - Assigned to huzooka
- Status changed to Needs work
10 months ago 5:43am 1 March 2024 - Issue was unassigned.
- Status changed to Needs review
10 months ago 10:15am 1 March 2024 - ๐ญ๐บHungary huzooka Hungary ๐ญ๐บ๐ช๐บ
Addressed review feedback, asking for a next review.
Adding the usual traditional patch too.
- last update
9 months ago Composer require-dev failure - ๐ซ๐ทFrance duaelfr Montpellier, France
I closed ๐ Unhandled exception in function ui_patterns_settings_form_field_storage_config_edit_form_alter Closed: duplicate as a duplicate of this issue.
Please consider crediting people that worked over there. - last update
8 months ago 2 pass, 2 fail - ๐ซ๐ทFrance Grimreaper France ๐ซ๐ท
Discussed with @Christian.wiedemann, I will try to check if both hooks can be preserved for backward compatibility instead of going to a hook_form_alter.
If not possible, we do a release then drop core 10.1 support in this issue.
- Assigned to Grimreaper
- Merge request !27Issue #3409221: ui_patterns_settings.module - array_unshift() โ (Merged) created by Grimreaper
- Issue was unassigned.
- ๐ซ๐ทFrance Grimreaper France ๐ซ๐ท
@herved, https://www.drupal.org/u/herved โ should also be credited. But as he only did code review in Gitlab, he is not appearing in the list.
-
Christian.wiedemann โ
committed 06ce8624 on 8.x-2.x authored by
Grimreaper โ
Issue #3409221 by Grimreaper, huzooka, Ahmad Abbad, ekes, Walli,...
-
Christian.wiedemann โ
committed 06ce8624 on 8.x-2.x authored by
Grimreaper โ
- Status changed to Fixed
7 months ago 4:04pm 5 June 2024 - ๐ฉ๐ชGermany Christian.wiedemann
The new version will only be for drupal 10.2 or above
Automatically closed - issue fixed for 2 weeks with no activity.
- ๐บ๐ธUnited States thejimbirch Cape Cod, Massachusetts
Updating attribution
- ๐ซ๐ทFrance Julien Tekrane
Thanks @DuaelFr for your mention. It was not done but not an issue for me. Most important : resolution