Closed (fixed)
Project:
Smart Date
Version:
4.1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
17 Dec 2023 at 09:32 UTC
Updated:
6 Apr 2024 at 15:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
sidharth_soman commentedApply this patch and it should remove the deprecation error. Please test.
Comment #3
sassafrass commentedThank-you! Patch worked for me!
Comment #4
tderego commentedYes. Patch works for me. Smart Date 4.0.3, Drupal 10.2.0.
Comment #5
johnlutzPatch works for me. Drupal 10.2.0. Smart Date 4.0.3
Comment #6
josh.fabeanAlso tested patch and removes the error for me.
Comment #7
rolodmonkey commentedComment #8
rolodmonkey commentedIs the 4.1 branch set up for automated testing? If so, the patch needs to be submitted in the correct way so that it will trigger automated testing.
Comment #9
rolodmonkey commentedI have applied this patch while running Drupal 10.2.0 and it works.
Comment #10
scotwith1tWorking for me as well. Hope to see this passing tests and RTBC soon :) Thanks!
Comment #11
transmitter commented#2 seems to be working fine here as well.
Thanks.
Comment #12
krug commented#2 works for me. Drupal 10.2.2 Smart Date 4.0.3 Thanks.
Comment #15
pcate commentedI made a MR of patch #2 for convenience.
Comment #16
mowgli4811 commented#2 worked for me. Drupal 10.2.3 Smart Date 4.0.3
Comment #17
mortona2k commentedPatch fixes issues in 4.1.0 as well.
The $values comes from the field settings form, it's a handcoded text area with an option on each line.
This patch does an explode on the values string to get a list. Then trims the lines and filters out empty values.
Looks good to me, my only concern is whether we're doing enough checking, but if the values are entered correctly this is working great.
Comment #18
heddn+1 on RTBC.
Comment #19
ransomweaver commentedRTBC looks good.
Comment #21
mandclu commentedThe unfortunate part of the change proposed is that it isn't backwards-compatible with versions of Drupal before 10.2 As such, I've added a commit to make Smart Date require Drupal 10.2 or newer.
Having core throw the deprecation warning everywhere a Smart Date widget is used is extremely annoying, but it feels very early to start requiring Drupal 10.2. Unfortunately this is probably something we're going to need to patch for a while.
The only other way I could see resolving this would be to remove the use of ListItemBase::extractAllowedValues() altogether and duplicate the logic within SmartDateListItemBase::parseValues() but I'd still prefer to stay aligned with how core handles the same kind of input.
Comment #22
anand.panure commentedAfter upgrading the module to 4.0 and applying this patch https://www.drupal.org/files/issues/2023-12-18/3409287.patch, my dbupdate command is failing to update the hook views_post_update_timestamp_formatter and I saw this module does implement that hook.
I am on Drupal 10.2.3.
Error Log below -
Comment #23
daisyleroy commented#2 works for me !
Comment #24
mglamanThis can use the be backwards compatibility call to support previous versions. See https://www.drupal.org/node/3379306
Assigning to myself and picking this up.
Comment #25
mglamanUpdated the MR.
If DeprecationHelper doesn't exist, use the deprecated code path for Drupal 9, etc.
If DeprecationHelper exists, allows the deprecated code path and new code path for all Drupal 10 and beyond versions
Comment #26
mglamanComment #28
mandclu commentedI was able to verify that the merge request removes the deprecation warning in Drupal 10, but allows the module to still work as intended with older versions of Drupal. Merged in, and will incorporate into a new release shortly. Thanks @mglaman!