Exceptions that apply to entire bundles

Created on 30 June 2023, 12 months ago
Updated 28 February 2024, 4 months ago

If you have hundreds of entities (locations) and want to set a date globally, it would be helpful to have a global date setting that would come up in the same list as hours-exceptions per entity->bundle. It would also be important to somehow get a timezone per entity.

✨ Feature request
Status

Closed: works as designed

Version

1.16

Component

Miscellaneous

Created by

πŸ‡ΊπŸ‡ΈUnited States devitate Orange County, CA

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

Comments & Activities

  • Issue created by @devitate
  • πŸ‡ΊπŸ‡ΈUnited States devitate Orange County, CA

    Bad title

  • πŸ‡³πŸ‡±Netherlands johnv

    Can you explain your use case in more detail?
    I guess you do not mean the default field value?

    I think a 'template' entity could be maintained, and a hook can retrieve that upon creating the display view.
    Is that in line with your view?

  • πŸ‡³πŸ‡±Netherlands johnv
  • πŸ‡§πŸ‡ͺBelgium tim-diels Belgium πŸ‡§πŸ‡ͺ

    I was looking at the same functionality and it would definitely be a nice addition.

    Let me explain our use case:

    A website has multiple stores and are managed with office hours. But to not have to set a vacation period per store, it would be nice to have like a global exception period that can be added and is added to all stores. For example Christmas period or construction leave. And that you can choose per store to apply the global exception (as sometimes you can have different construction leave in one country)

  • πŸ‡§πŸ‡ͺBelgium tim-diels Belgium πŸ‡§πŸ‡ͺ

    For now I overwritten the office_hours_preprocess_office_hours() and hardcoded get the references of a vocabulary. If this is something you are willing to review, I could for example create it differently and allow to select a entity reference field on the field formatter to allow to select a vocabulary and display them within the exceptions on rendering. Or even provide a field setting so it is automatically added to the widget?
    I did not yet do this because of budget reasons on our project, but I'm willing to look into this further but first need feedback from a maintainer (or someone else) to see what direction we would be willing to go.

    All suggestions are welcome.

  • πŸ‡³πŸ‡±Netherlands johnv

    I'd like to see your code.
    I am not that much into theming, and tend to put everything in php.

    So you store the defaults in a vocabulary. That is smart.
    And adding the vocabulary to the formatter makes the entity free from those general settings, since it is only in the display.
    And using the season feature, the global exception days can be on and off. Nice.

    The latest version uses some new technique to sort the days. You do that in your preprocessing?

  • Status changed to Closed: works as designed 4 months ago
  • πŸ‡³πŸ‡±Netherlands johnv

    I guess this can also be done with some small code via ✨ Formatter: Add Event to allow other modules to modify values Fixed .

    The common data can be taken from any other object/entity/taxonomy term.
    Feel free to re-open if you have alternative solutions.

Production build 0.69.0 2024