Notice: Undefined index: #value in Drupal\smart_date\Plugin\Field\FieldWidget\SmartDateWidgetBase::validateStartEnd() (line 394 of modules/contrib/smart_date/src/Plugin/Field/FieldWidget/SmartDateWidgetBase.php).

Created on 27 January 2022, almost 3 years ago
Updated 27 August 2024, 3 months ago

Problem/Motivation

Form validation is looking in wrong spot for dateTimeObject.

Steps to reproduce

Add start and end dates, submit node form. Error appears on node view.

Proposed resolution

Grab the #default_value

πŸ› Bug report
Status

Postponed: needs info

Version

4.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States EthanT Sarasota, Florida

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States thefancywizard

    I am still having this issue on the newest release of Smart Date (4.0.3) on Drupal 9.5.9, so I rerolled the patch from this issue against the newest module version. After applying the patch I no longer see the error on node save.

  • Status changed to Needs review over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States EthanT Sarasota, Florida
  • Status changed to Postponed: needs info over 1 year ago
  • πŸ‡¨πŸ‡¦Canada mandclu

    I'm still not able to reproduce this issue. I tried on a fresh install of Drupal 9.5.10 with Smart Date 4.0.3. I tried submitting a node with and without field values, with Smart Date and core daterange fields.

    I won't be putting any work into reviewing code until I have clear steps to reproduce the problem on a clean install.

  • πŸ‡ΊπŸ‡ΈUnited States EthanT Sarasota, Florida

    Understood that you can’t reproduce, and apologies for the frustration, but multiple people are experiencing this issue. Not sure what more can be said about the steps to reproduce.

  • πŸ‡¨πŸ‡¦Canada mandclu

    Let's maybe try something else: if you install the Smart Date Starter Kit on a fresh install of Drupal, do you see the error? Or does the configuration have to be changed in some way to see it?

  • πŸ‡ΊπŸ‡ΈUnited States EthanT Sarasota, Florida

    I'm seeing this against a new install of 10.0.9.

  • πŸ‡¨πŸ‡¦Canada mandclu

    @EthanT you're seeing this on a fresh install of Drupal, using the Smart Date Starter Kit?

  • πŸ‡ΊπŸ‡ΈUnited States EthanT Sarasota, Florida

    Not sure what you mean by Starter kit. I’m installing via composer and then drush enabling the module.

  • πŸ‡¨πŸ‡¦Canada mandclu

    The Smart Date Starter Kit β†’ provides a known-good set of configuration for working with Smart Date. If you can reproduce the problem using that, then it will help to establish that this is indeed a code-level problem. If you need to change the configuration in order to reproduce the problem, then that will likely provide the extra information I need to reproduce the problem as well.

  • πŸ‡ΊπŸ‡ΈUnited States thefancywizard

    Updating the patch as I noticed the value for start_date was falling back to default value even when a value was available. I will try to replicate using a fresh Drupal install + Starter Kit and report back as well.

  • πŸ‡¨πŸ‡¦Canada megan_m

    I was able to make this error go away by uninstalling DateTime hide Seconds module. But I also wasn't able to replicate it using the Smart Date starter kit + DateTime hide Seconds on a clean install. SO it might have to do with that module + some other configuration ?

  • Posting the static patch because using the MR doesn't allow pinning to a specific commit, so anyone can submit pretty much anything and inject it into our codebase IIRC. This also fixed our issue.

Production build 0.71.5 2024