- Issue created by @drubb
- 🇮🇳India sidharth_soman Bangalore
Apply this patch and it should remove the deprecation error. Please test.
- 🇺🇸United States tderego Starkville, MS
Yes. Patch works for me. Smart Date 4.0.3, Drupal 10.2.0.
- 🇺🇸United States johnlutz
Patch works for me. Drupal 10.2.0. Smart Date 4.0.3
- 🇺🇸United States josh.fabean Florida
Also tested patch and removes the error for me.
- Status changed to Needs review
11 months ago 3:40pm 9 January 2024 - 🇺🇸United States RoloDMonkey
Is 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.
- 🇺🇸United States RoloDMonkey
I have applied this patch while running Drupal 10.2.0 and it works.
- 🇺🇸United States scotwith1t Birmingham, AL
Working for me as well. Hope to see this passing tests and RTBC soon :) Thanks!
- First commit to issue fork.
- Merge request !813409287: Deprecation in Drupal 10.2: Smart Date List Item allowed values must be passed as array → (Merged) created by pcate
- 🇧🇪Belgium mowgli4811
#2 didn't work for me. Composer couldn't apply the patch. Drupal 10.2.3 Smart Date 4.0.3
- Status changed to RTBC
9 months ago 4:42am 28 February 2024 - 🇺🇸United States mortona2k Seattle
Patch 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.
- First commit to issue fork.
- 🇨🇦Canada mandclu
The 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.
- 🇺🇸United States anand.panure
After 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 -
> [notice] Update started: views_post_update_timestamp_formatter > [error] Error: Call to a member function getType() on null in Drupal\views\Plugin\views\field\EntityField->defineOptions() (line 375 of /var/www/html/docroot/core/modules/views/src/Plugin/views/field/EntityField.php) #0 /var/www/html/docroot/core/modules/views/src/Plugin/views/PluginBase.php(143): Drupal\views\Plugin\views\field\EntityField->defineOptions() > #1 /var/www/html/docroot/core/modules/views/src/Plugin/views/HandlerBase.php(109): Drupal\views\Plugin\views\PluginBase->init() > #2 /var/www/html/docroot/core/modules/views/src/Plugin/views/field/FieldPluginBase.php(136): Drupal\views\Plugin\views\HandlerBase->init() > #3 /var/www/html/docroot/core/modules/views/src/Plugin/views/field/EntityField.php(199): Drupal\views\Plugin\views\field\FieldPluginBase->init() > #4 /var/www/html/docroot/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php(899): Drupal\views\Plugin\views\field\EntityField->init() > #5 /var/www/html/docroot/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php(927): Drupal\views\Plugin\views\display\DisplayPluginBase->getHandlers() > #6 /var/www/html/docroot/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php(963): Drupal\views\Plugin\views\display\DisplayPluginBase->getAllHandlers() > #7 /var/www/html/docroot/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php(71): Drupal\views\Plugin\views\display\DisplayPluginBase->calculateDependencies() > #8 /var/www/html/docroot/core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php(89): Drupal\Core\Config\Entity\ConfigEntityBase->getPluginDependencies() > #9 /var/www/html/docroot/core/modules/views/src/Entity/View.php(283): Drupal\Core\Config\Entity\ConfigEntityBase->calculatePluginDependencies() > #10 /var/www/html/docroot/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php(321): Drupal\views\Entity\View->calculateDependencies() > #11 /var/www/html/docroot/core/modules/views/src/Entity/View.php(293): Drupal\Core\Config\Entity\ConfigEntityBase->preSave() > #12 /var/www/html/docroot/core/lib/Drupal/Core/Entity/EntityStorageBase.php(528): Drupal\views\Entity\View->preSave() > #13 /var/www/html/docroot/core/lib/Drupal/Core/Entity/EntityStorageBase.php(483): Drupal\Core\Entity\EntityStorageBase->doPreSave() > #14 /var/www/html/docroot/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php(257): Drupal\Core\Entity\EntityStorageBase->save() > #15 /var/www/html/docroot/core/lib/Drupal/Core/Entity/EntityBase.php(352): Drupal\Core\Config\Entity\ConfigEntityStorage->save() > #16 /var/www/html/docroot/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php(609): Drupal\Core\Entity\EntityBase->save() > #17 /var/www/html/docroot/core/lib/Drupal/Core/Config/Entity/ConfigEntityUpdater.php(192): Drupal\Core\Config\Entity\ConfigEntityBase->save() > #18 /var/www/html/docroot/core/lib/Drupal/Core/Config/Entity/ConfigEntityUpdater.php(147): Drupal\Core\Config\Entity\ConfigEntityUpdater->doOne() > #19 /var/www/html/docroot/core/modules/views/views.post_update.php(82): Drupal\Core\Config\Entity\ConfigEntityUpdater->update() > #20 /var/www/html/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(280): views_post_update_timestamp_formatter() > #21 [internal function]: Drush\Commands\core\UpdateDBCommands::updateDoOnePostUpdate() > #22 /var/www/html/vendor/drush/drush/includes/batch.inc(257): call_user_func_array() > #23 /var/www/html/vendor/drush/drush/includes/batch.inc(204): _drush_batch_worker() > #24 /var/www/html/vendor/drush/drush/includes/batch.inc(75): _drush_batch_command() > #25 /var/www/html/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(136): drush_batch_command() > #26 [internal function]: Drush\Commands\core\UpdateDBCommands->process() > #27 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array() > #28 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback() > #29 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter() > #30 /var/www/html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(391): Consolidation\AnnotatedCommand\CommandProcessor->process() > #31 /var/www/html/vendor/symfony/console/Command/Command.php(326): Consolidation\AnnotatedCommand\AnnotatedCommand->execute() > #32 /var/www/html/vendor/symfony/console/Application.php(1096): Symfony\Component\Console\Command\Command->run() > #33 /var/www/html/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand() > #34 /var/www/html/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun() > #35 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(110): Symfony\Component\Console\Application->run() > #36 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun() > #37 /var/www/html/vendor/drush/drush/drush.php(139): Drush\Runtime\Runtime->run() > #38 /var/www/html/vendor/drush/drush/drush(4): require('...') > #39 /var/www/html/vendor/bin/drush(120): include('...') > #40 {main}. > [warning] Drush command terminated abnormally. In ProcessBase.php line 171: Unable to decode output into JSON: Syntax error Error: Call to a member function getType() on null in Drupal\views\Plugin\views\field\EntityField->defineOptions() (line 375 of /var/www/html/docroot/core/modules/views/src/Plugin/views/field/EntityField.php).
- Assigned to mglaman
- Status changed to Needs work
8 months ago 8:22pm 21 March 2024 - 🇺🇸United States mglaman WI, USA
This 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.
- Issue was unassigned.
- Status changed to Needs review
8 months ago 3:06pm 22 March 2024 - 🇺🇸United States mglaman WI, USA
Updated 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 - Status changed to Fixed
8 months ago 3:38pm 23 March 2024 - 🇨🇦Canada mandclu
I 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!
Automatically closed - issue fixed for 2 weeks with no activity.