- ๐ฎ๐ณIndia junaidpv Kannur, Kerala
Same as #50 but handling "Undefined variable $element" warning messages additionally.
- Merge request !7239feat(datetime): Allow configurable date attributes via #date_increment โ (Open) created by dww
- ๐บ๐ธUnited States dww
There was an ancient issue fork here with no 11.x branch and no MR. I just pushed a ton of modern commits into it, then #50 as a real commit, and opened https://git.drupalcode.org/project/drupal/-/merge_requests/7239.
Let's see what the bot now thinks. I'll also try some local manual testing...
- ๐บ๐ธUnited States dww
Had to step away for a while. Pushed some more commits to make phpstan happy. Local testing result is that all seems to work as expected.
Note to any folks who are having trouble, this is a widget setting, not a field setting. Updating the title to hopefully be more clear.
However, I notice that the 'Select list' widgets already support this setting, but call it "Time increments". The new setting for the 'Date and time' widgets is now called "Step". We almost certainly want to be consistent here. Any objections to changing the new setting to mimic the existing one?
- ๐บ๐ธUnited States dww
Screenshots of both the existing widget settings form for the 'Select list' datetime widget, and the new settings form for the 'Date and time' widget added with this MR. Shows we need to be consistent here, IMHO.
- ๐บ๐ธUnited States seanr
Do we have a working patch for D10, or can a backport be made? I just got a client request that needs this and obviously the D10 diff didn't apply. ๐
- ๐บ๐ธUnited States dww
https://git.drupalcode.org/project/drupal/-/merge_requests/7239.diff works against
10.2.x
as of right now. It doesn't apply cleanly directly withgit apply
, but it works withpatch -p1 < 7239.diff
. That's what I've been using. ๐ - ๐บ๐ธUnited States seanr
How can I get composer to do that? Here's what I just tried with no luck:
{ "patches": { "drupal/core": [ { "description": "#2699895: Date increment fix", "url": "https://git.drupalcode.org/project/drupal/-/merge_requests/7239.diff", "depth": 1 } ], ...
Error from composer:
No available patcher was able to apply patch https://git.drupalcode.org/project/drupal/-/merge_requests/7239.diff to drupal/core
- ๐บ๐ธUnited States seanr
More detail:
'git' -C '/var/www/html/web/core' apply --check --verbose -p1 '/mnt/ddev-global-cache/composer/patches/a3bd64da48f2f91a9432010435e27ddba600cadf60f985ff08e5cfc3b25b35c6.patch' Checking patch core/lib/Drupal/Core/Render/Element/Date.php... error: core/lib/Drupal/Core/Render/Element/Date.php: No such file or directory Checking patch core/modules/datetime/config/schema/datetime.schema.yml... error: core/modules/datetime/config/schema/datetime.schema.yml: No such file or directory Checking patch core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDefaultWidget.php... error: core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDefaultWidget.php: No such file or directory Checking patch core/modules/datetime_range/config/schema/datetime_range.schema.yml... error: core/modules/datetime_range/config/schema/datetime_range.schema.yml: No such file or directory Checking patch core/modules/datetime_range/src/Plugin/Field/FieldWidget/DateRangeDefaultWidget.php... error: core/modules/datetime_range/src/Plugin/Field/FieldWidget/DateRangeDefaultWidget.php: No such file or directory Checking patch core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldWidgetSettingsTest.php... error: core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldWidgetSettingsTest.php: No such file or directory
- ๐บ๐ธUnited States dww
Off topic from this issue, but you should never point composer at a GitLab MR. Anyone could push broken or malicious code to the MR but the path doesnโt change and composer will happily try to apply the now broken or vulnerable code to your site.
Download the patch. Store it locally. Tell composer to apply that. Iโve got a clean checkout for core development. Apply it there. Make a new patch. Put that in your composer.
- ๐บ๐ธUnited States seanr
Hadn't thought of that (still more used to the old-school patches that were static once uploaded). Thank you.