"Copy previous day" operation does not copy AM/PM selections

Created on 9 January 2025, 27 days ago

Problem/Motivation

The "Copy previous day" operation in the field editor does not copy over the AM/PM selections from the previous day. It is only copying the hour and minute selections.

Additionally, the "Clear" operation appears to be broken and does nothing.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

1.20

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States gallegosj

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

Comments & Activities

  • Issue created by @gallegosj
  • πŸ‡ΊπŸ‡ΈUnited States gallegosj
    • johnv β†’ committed 26b0115d on 8.x-1.x
      Issue #3498546 by gallegosj: Clear does not work since 8.x-1.20
      
  • πŸ‡³πŸ‡±Netherlands johnv

    Please try above one-liner. It fixes the 'Clear' issue. (I keep getting confused with contradicting phpcs instructions in PHP vs. JS)
    I cannot reproduce the am/pm issue after the fix.

    Please report back with your results.

  • πŸ‡³πŸ‡±Netherlands johnv
  • πŸ‡ΊπŸ‡ΈUnited States gallegosj

    I upgraded to 1.21 and both issues remain. "Copy previous day" will not copy AM/PM selections, and the "Clear" operation does nothing.

    When I try running Cron I receive the following error:
    Caught exception: Attempted to create, modify or delete an instance of field with name field_hours on entity type node when the field storage does not exist. The website encountered an unexpected error. Try again later.

  • πŸ‡³πŸ‡±Netherlands johnv

    When I change the field setting from HTML5 into Select List, I get the following error, presumable from the (hidden) default value widget:
    Warning: Undefined array key "hour" in Drupal\office_hours\Element\OfficeHoursDatelist::valueCallback() (line 52 of ...\office_hours\src\Element\OfficeHoursDatelist.php)

  • πŸ‡³πŸ‡±Netherlands johnv

    I fixed the above error in #3500427-2: Warning: Undefined array key "hour" in OfficeHoursDatelist when changing 'Time element type' β†’ . The error does not influence any other behaviour, though.

  • πŸ‡³πŸ‡±Netherlands johnv

    Please try dev version, not latest release.

  • πŸ‡³πŸ‡±Netherlands johnv
  • πŸ‡ΊπŸ‡ΈUnited States gallegosj

    Using latest dev version. "AM/PM" selections are being copied in the Seasons widget only. Issue remains for Week widget and Exceptions widget.

    "Clear" button appears to be fixed on all widgets now. Thanks!

    Previous reported error persists upon Cron run.
    Caught exception: Attempted to create, modify or delete an instance of field with name field_hours on entity type node when the field storage does not exist. The website encountered an unexpected error. Try again later.

  • πŸ‡³πŸ‡±Netherlands johnv

    I cannot reproduce the 'copy' error.
    what happens when you change from exceptions widget to normale week widget (where you cannot see season/exception)?
    what theme do you use? Does it happen with an out of the box Drupal core theme?

    I also cannot see the 'caught exception'. I guess both have to do with another.
    did you run update.php?

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

    Switching to the normal week widget (without exceptions) makes no change. I am using the core Claro theme for administration. No pending updates for update.php.

    Drupal 10.3.11, PHP 8.3.14

Production build 0.71.5 2024