Subfield "Season name" forces whole field to be required

Created on 16 January 2025, 19 days ago

Problem/Motivation

Office hours is not a required field but enabling seasons makes it required

I need to provision for, but not require, office hours, and seasons is a nice to have, but again optional.
In order to facilitate this, the required status of the season name needs to be removed/altered.

Steps to reproduce

Add an office hours field
Make it not required
Enable "allow seasons"
If none of the data is entered (as per "not required" field!), the lack of input of "Season name" cascades up and makes the whole field required, which... is problematic.

Proposed resolution

Conditionally require the season name subfield, or add seasons using button (see also: https://www.drupal.org/project/office_hours/issues/3498630 Button to "Add New Season" similar to "Add Exception" Active which is a nice to have, but it would also fix this I think?)

Remaining tasks

TBC

User interface changes

Season name not required subfield

API changes

n/a

Data model changes

n/a

🐛 Bug report
Status

Active

Version

1.21

Component

User interface

Created by

🇬🇧United Kingdom niklp Nottingham

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

Comments & Activities

  • Issue created by @niklp
  • 🇬🇧United Kingdom niklp Nottingham
  • 🇳🇱Netherlands johnv

    I get your point.
    As a matter of fact, the requirement is not analyzed at all. When entering times in a season, without setting the title or dates, the season is not stored.
    The SeasonName is only required when ster/end dates are entered.

    • johnv committed e0f70e51 on 8.x-1.x
      Issue #3500350: Subfield 'Season name' seems required in widget
      
  • 🇳🇱Netherlands johnv

    Let's just remove the 'required' setting to start with.
    The checks are a bit more complicated, but I have no time to figure out the #states, that would solve the UX.

  • 🇬🇧United Kingdom niklp Nottingham

    Hi JohnV, thanks for the feedback (and sensible edits to the issue)

    I'm not sure what has been changed here? You stated:

    Let's just remove the 'required' setting to start with.

    however I don't see any changes to the required status of the entire field whilst using v1.21?

  • 🇳🇱Netherlands johnv

    My method of using the version is: the problem exists and is fixed in the latest/current version (1.21) and will be included in the next version 1.22)

    So dev version should now contain your issue.

  • 🇬🇧United Kingdom niklp Nottingham

    Roger that, TYVM sir 👍

  • 🇳🇱Netherlands johnv
Production build 0.71.5 2024