Problem/Motivation
I think something like exception day can be great idea.
For example, let's say we are open every Sunday, except on 24-dec (X-mas) every year.
User should select exact days (date from calendar, with repeat option) when the office is closed.
It can be valuable for most of us.
User interface changes

Data model changes
The 'day' column now has value 0-6 for the weekdays.
It will now also be used as a 'timestamp' to hold calendar dates, since this fits in the INT11 field type.
Here is a discussion on schema.org regarding both: https://github.com/schemaorg/schemaorg/issues/245:
So here is a proposal that addresses the above scenario:
- make it explicit that openingHours captures the general opening hours
- make it explicit that openingHoursSpecification captures general and/or explicit opening hours
| Comment | File | Size | Author |
|---|---|---|---|
| #111 | office-hours-exceptions-1998266_111.patch | 31.73 KB | spadxiii |
| #111 | interdiff-101-111.txt | 16.85 KB | spadxiii |
| #103 | office-hours-exceptions-1998266_103.patch | 30.64 KB | spadxiii |
| #101 | office-hours-exceptions-1998266_101.patch | 63.36 KB | johnv |
| #85 | office-hours-exceptions-1998266-80-remains.patch.txt | 8.9 KB | johnv |
Issue fork office_hours-1998266
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 1998266-add-exception-day
changes, plain diff MR !9
Comments
Comment #1
johnvI think this is covered in #1743366: [Season Meta] Add "Seasonal Hours / Duration" feature
Comment #2
johnvAs a work-around, I added a text field to my node type, which describes the exceptions.
Comment #3
johnvSee #1743366: [Season Meta] Add "Seasonal Hours / Duration" feature
Comment #4
apoc1 commentedI'm sorry to re-open this post. I think what adelka wants, is to add an exception date to the listed opening hours. It is not impossible to achieve this with the solutions found in #1743366: Add "Seasonal Hours / Duration" feature, but then you're supposed to make for each holiday a field collection. I was just wondering if it would be possible to maybe add an 'exclusion' sub-field where you can specify a certain date (e.g. 24/12/2014)?
Comment #5
marcoka commentedcheck fork: https://www.drupal.org/project/opening_hours
Comment #6
johnvSee both linked issues for D7 and D8. It adds a 'comment' column to each time slot.
Perhaps, we can build upon that.
Comment #7
johnvPushing to D8.
ITMT, both D7 and D8 versions have a 'comment' field on each time slot. That might suffice for some use cases.
Comment #8
luksakAnother workaround would be to provide an alter hook. In my current case i would be able to alter the results and exclude dates from another field on the same entity.
Comment #9
luksakI ended up writing a patch for my current use case. It uses a date field on the same entity to exclude holidays completely. Specifying special office hours is not possible.
We could extend this feature by making the date field configurable. This is currently hard coded.
Another limitation is that the patch only performs it's logic if the "Show next open day" display is used.
I guess there are some coding issues in this patch... I needed a quick fix :)
Comment #10
merilainen commentedTo make this more generic, I think it would be better to be able to add individual exception days with different start and end dates. If the values are empty, then it would mean closed. These could be optionally invisible for the user, so that the hours would just display differently on the exception days.
Even better if the actual values would change based on some exception rules. For example we have services indexed in Elasticsearch, saving the entities would index them automatically also.
Comment #11
idflood commentedSo I started working on a patch, there is still a lot to do but it's starting to take shape I think. Let me know if something goes in the wrong direction or if you have any tip.
The current table holds the day in a `int` column with a length of 11, so that is perfect to store the timestamp of the exception days. So instead of creating a new Field type and all the other things I took the following approach:
- Reuse most of the existing field & features
- Create a submodule "office_hours_exceptions" so that this feature stays optional
- We store the week days from 0 to 6 as current implementation, and add exceptions as timestamp
- We add a formatter based on the table one
Eventually there is still no tests, validation is not done, and data is not 100% correctly saved. For instance if you add an exceptions with just one slot (a start and end hour) it will be stored 3 times if there is a max 3 slots.
You can see how it looks in the backend here: https://www.drupal.org/files/issues/2018-05-07/drupal-office-hours-excep...
Comment #12
idflood commentedHere is a new patch, this time basic features works good I think. For this patch I also included the one in https://www.drupal.org/project/office_hours/issues/2860041#comment-12543759 since special hours are most of the time for closed days. With the patch it saved correctly the data but I needed to add some logic to display correctly the labels and the "Closed" element.
Here are a few things which still need to be done:
- validation
- tests
- schema handling
- it's only implemented for the table formatter
- the "closed" or "isOpen" and most of the logic in OfficeHoursItemList is still untouched
Comment #13
idflood commentedSorry, patch in 12 was wrong.
Comment #14
yusufhm@idflood after I applied the patch, the widget was not working properly and AJAX was throwing errors. I made a couple changes after which it started working.
Attaching the new patch & interdiff.
Comment #15
j3ll3nlIt would be great if the exceptions are being mixed up in the hours so that they are actually changed to the exception dates.
Comment #16
anruetherThe patch in #14 does not apply to dev anymore.
Comment #17
henry tran commentedHi @anruether
I've re-roll patch #14.
Cheers
Comment #18
megadesk3000 commentedHi together
i added some fixes and improvements to the patch
- fixed isOpen/isClosed logic to also taking the exception days into account (only the closed open batch above or below the list)
- show only exception in the future
- configuration of the days in the future we want to display the exceptions (like: next 7 days)
Comment #19
megadesk3000 commentedAdded a fix for 18 to be able to handle more exception slots in a day.
Comment #20
megadesk3000 commentedAdd check for empty exceptions to prevent php warnings.
Comment #21
megadesk3000 commentedWe found a bug, when a exception day is completely closed, then the status text still shows as open.
Corrected that with this patch.
Comment #22
bartzaalberg commentedI changed the 'Add element' to 'Add exception'. The button wasn't very clear to me. That also solved a problem with conflicting translation strings.
Comment #23
bartzaalberg commentedWhoops. That actually didn't change the "Add element' button to "Add exception". This does.
Comment #24
suegmune commentedWe have a university library with seasonal hours and MANY exceptions. We used this module in D7 and are trying to use it in D8, but it isn't working for us the way that we are doing it. I know there was talk of field collections (obsolete) and paragraphs in https://www.drupal.org/project/office_hours/issues/1743366, but no movement in a couple years.
I created an hours entity with a single paragraph field with these fields:
Label (ie. 'Fall Hours')
Date Range (when the hours are relevant)
Hours Field
I create a paragraph and include an hours field, the "Copy Previous" doesn't work at all for exceptions.
When I create a second paragraph and include several exceptions (again, copy previous does not work), and save, and go back into the entity, all exceptions in the second paragraph are deleted.
Using D8.8.1, and using patch #23 here, and #7 from https://www.drupal.org/project/office_hours/issues/3065611#comment-13396155
Comment #25
suegmune commentedI'm finding if I bring these hours into views (which I'm trying to do to allow multiple blocks of hours ie. Fall Hours, Winter hours), exceptions are not working properly.
When I choose to set Number of days to show to "Show all days", and formatter to "plain text", there is no distinguishing between exceptions and normal hours. Output looks like this (just showing a normal day, and one exception):
If I set formatter to "table with exceptions", it doesn't display the exceptions at all.
When I have a day with an exception on it, and i set Number of days to show to "Show only current day", it doesn't show me the exception day, it shows me the hours set on the normal hours schedule.
Comment #26
luksak@suegmune The path the maintainer chose is clearly not using paragraphs. I have a very specific implementation for my use case using paragraphs, but it has a lot of flaws...
I'd suggest not to take your own route, but to help get this patch working.
Comment #27
tessa bakkerCreated a new patch.
Changes:
* Removed cck migration, to focus purely on the field itself (please create new ticket if needed)
* Fixed some parts to make it work with version 1.3
* Replaced t() functions
* Fixed a lot of code style issues, the module has a lot of them, but I tried to make this code easier/faster to understand.
* Restored issue summary
Todo:
* Make the code smarter, lot of copy/past code from the module itself
* Remove unclear commented code
Any feedback is welcome!
Comment #28
spadxiii commentedI've add the same empty-check as made in https://www.drupal.org/project/office_hours/issues/3180379 for when the time is set to 0:00.
Also added limit validation errors to the 'Add exception'-button, because it was validating the whole form instead of just adding another row.
Comment #29
spadxiii commentedAnd I noticed another error which would convert the exception days to time twice. This resulted in an incorrect value and a query exception.
Comment #30
spadxiii commentedUpdated the patch a bit to fix the drupal 9 compatibility issues
Comment #31
zenimagine commentedGreat, thanks for your work. I tested the patch and it is missing some important elements.
In the screenshot, i need a start date and an end date (eg for holidays). I think we should add "Add date slot", with an end date.
In the timetable rendering, the dates are not displayed and it is inconsistent.
Comment #32
zenimagine commentedWould it be possible to display a status. That could be used in views or a custom module.
Example : I have a store and its owner is on vacation.
A warning message (a view block) might be displayed in the store.
A custom module could temporarily disable sales (the add to cart button) depending on the status.
Example : a pickup relay contrib module, could offer in the purchase tunnel, the pickup relays available using this module.
Example : the Group module could refuse new member requests during unavailability dates
Comment #33
drugan commentedWhile trying to figure out how the Office hours exceptions submodule works I hit two errors (see the screenshot attached).
Fixed these errors just to simplify further work on the submodule.
Comment #34
johnvComment #35
johnvComment #36
ethomas08 commentedFixed the patch since it broke between the 8.x-1.2.0 and 1.3.0 release.
Comment #37
ethomas08 commentedRe-rolled specifically for the 8.x-1.3.0 release.
Also should mention what broke between 1.2.0 and 1.3.0 -- clicking on the "Add Exception" button results in nothing happening.
Error in the console window:
Uncaught Drupal.AjaxError
message: "\nAn AJAX HTTP error occurred.\nHTTP Result Code: 200\nDebugging information follows.\nPath: /node/68542/edit?ajax_form=1\nStatusText: OK\nResponseText: \nNotice: Undefined index: #hour_options in /Users/home/project/web/modules/contrib/office_hours/src/Element/OfficeHoursDatelist.php on line 109.
Error: Unsupported operand types in Drupal\\Core\\Render\\Element\\Select::processSelect() (line 152 of /Users/home/project/web/core/lib/Drupal/Core/Render/Element/Select.php)
name: "AjaxError"
__proto__: Error at http://web.lvhn.localhost/core/misc/ajax.js?v=8.9.14:100:32 at http://web.lvhn.localhost/core/misc/ajax.js?v=8.9.14:644:3
Comment #38
ethomas08 commentedThird time is a charm. Forgot to commit the actual bug fix.
Comment #39
johnvComment #40
johnvComment #41
johnvThe following should be added, according to #3216490: Check "Exception day" is empty :
Comment #42
spadxiii commentedDid a quick re-roll of #38, with the changes suggested in #41.
provided patch is empty, because I forgot a > in the git diff command... in #44 the patch does have some contents :)
Comment #43
johnv@SpadXIII, the patch is empty :-(
Comment #44
spadxiii commentedoops! reposting the patch
Comment #45
spadxiii commentedThe latest changes in the module and the latest patches aren't working properly just yet. I'm looking into figuring out what and how.
Comment #46
spadxiii commentedHere's a new patch, with the changes correctly applied and looks to be working fine as well.
Comment #47
ethomas08 commentedApologies for butchering some of the code here. I ran all the files in the modules/office_hours_exceptions directory through a code sniffer and fixed all errors and warnings. I hacked together a few things in order to get working a use case that was not working:
If a user enters in an exception row with a date but no start or end time. The behavior should be that the exception date is by default closed and appears on the node display as closed. Also, when going back to the node edit view, the exception row should display as inputted. I was seeing the correct values in the database but not in either the node display or node edit form display.
I made a lot of changes to the js/office_hours.js file to get the "Copy previous day" functionality working. I have not tried the patch from comment 46 to see if that fixes it.
Comment #48
johnvI am also working on the patch #46. mostly removing removing code by not copying code, but subclassing. The current code is very much outdated.
However, It seems I broke some stuff, so i will start again with $48.
Comment #49
johnv@SpadXIII,
I now see that your patch #42-#$46 are very much different from the other chain of patches. What is your source?
For instance, the main patch has a submodule. Yours has not.
[EDIT] I see, your source is #38, given your interdiff. Indeed, a submodule might not be needed.
Comment #50
johnvPlease find attached a reworked version of #46 (not #47).
It merely removes code, by not copying files, but subclassing existing classes.
I was not aware that #46 was not a main-stream patch. I assume/hope that the contents of the files is identical.
Are we sure we need a new submodule?
Comment #51
spadxiii commentedI picked the patch in #38 indeed and was surprised the submodule to be removed.
For functionality it's not needed, but on the other hand it might be nice and easy way to disable/remove the functionality by having it in a submodule.
Comment #52
josh.fabeanI found a minor bug in patch 46 that makes the exception table output all exceptions regardless of setting due to it returning $element before actually processing any of them in the viewElements function.
Comment #53
josh.fabeanRerolled that patch to actually apply.
Comment #54
johnvIt seems we now have a Fork. Let's agree on the patch to work with.
It seems patch #47 is the last patch from the 'submodule'. Let us use that one. That is the one most ppeople work with.
@josh.fabean, can you re-work #47?
@SpadXIII, do you remember if you add some features, bug fixes, in your patch?
Some remarks on the current status (based on the 'wrong' patch #46):
- As a maintainer, I am not very keen on having a submodule in such a small module. So, in the end, I guess this will disappear in favour of some setting.
- The patch also makes the current Formatter working with dates, so a separate formatter might not be needed.
- The migrate file (last file in the patch) can be removed in the next patch, as @ethomas08 already stated. This is already in the project via another separate ticket. The file dates back from #11, three years ago.
- I will again rework the patch, to remove duplicated code, and subclass where possible.
Comment #55
johnvBTW,
isn't it possible to add a 'date range' to this feature?
Comment #56
johnvComment #57
johnvPlease find attached a new patch.
- Some code was replaced by subclassing;
- Some code parts from #47 are removed/commented out, since it does not have the desired effect;
- I did not check the Formatters. The standard table/PlainText formatters work just fine (Except for the extra options, ofcourse)
- Javascript is not working as desired.
- Ajax callback was removed, since it makes the [Add exception] button not working. Perhaps is should be re-added.
Comment #58
johnvThe attached patch now has working js links again, after removing the ['day']['day_index'] part of the widget.
The ExceptionsFormatterStatus is removed, since the normal one works fine.
The ExceptionsFormatter is shorter, but in the process, I removed the special 'exceptions days' markup. Please check the result.
The ExceptionWidget is renamed to ExceptionsWidget (mind the 's'), so you'll need to remove this file, too.
Can someone upload a screendump of the Formatter from before this patch?
Comment #59
johnv@ethomas08, regarding your comment #47, 'to get the "Copy previous day" functionality working'.
I guess your js code is outdated, due to the removal of [day][day_index] structure. js is now working better than before.
probel is that we are now mixing the 'week' widget for weekdays with the 'list' widget for dates.
I porpose you join forces in #3219980: Improve "Copy previous day" functionality to List Widget for the js part.
Comment #60
ethomas08 commented@johnv, wow, I am so excited to see all the work on this issue in just 2 weeks! I haven't had time to try any of the new patches yet but have high hopes. Thanks for pointing me to issue 3219980.
Comment #61
johnvPlease find attached a new version with fewer code (thanks to some technical code changes in the standard code base).
It took me a very long time, due the difficult FORM API behaviour.
Some open issues:
- as told, the Formatter from #46 is now empty, removed OfficeHoursExceptionsFormatter::viewElements().
- having a 'closed' exception day without hours ánd without comment is still not possible.
- some js-links are not hidden/displayed properly.
- more testing/fixing is needed in the UX.
- the saved day is now strtotime('some day midnight')
This patch still does not facilitate #1743366: [Season Meta] Add "Seasonal Hours / Duration" feature.
(How) can we incorporate that?
Comment #62
johnvComment #63
ethomas08 commentedAdded a patch building on johnv's work, hacking it to add a separate table line entry that says "Modified Hours" and only lists the exception entries that are 4 months from today's date.
Comment #64
ethomas08 commentedIt helps to git add the modules directory.
Comment #66
johnvComment #67
johnvAbove commit contains the /src/ code from #61, just to make way for other issues in the queue.
Comments from #61 still apply.
Attached is the remainder (/modules/ directory).
@thomas08, it did not take into account your changes. I noticed too late that this issue had updates.
I will merge your patch.
Comment #68
johnv@ethomas08,
There are also changes in src/OfficeHoursFormatterTrait.php , which you do not seem to address in your comment.
I have committed the 'comment' part in #3232142: Simpler formatSlots() for comments.
I still need to figure out what the 'serialize($times' part does.
Function template_preprocess_office_hours_table() adds a separator row, but only on top of the table, in my case.
The formatter 'Table (with exceptions)' already has a setting "EXCEPTION DAYS HANDLING - Restrict exceptions display to x days in future", so the theme function should not need to handle that.
Comment #69
johnv@ethomas08, indeed there was an error in Groupdays, due to this issue-commit or another.
#3232160: Fix groupDays() was committed, so your patch for OfficeHoursFormatterTrait.php is not completely handled (If my changes cater for your needs :-) )
Comment #70
johnv@ethomas, this is now the theme function in fewer lines. It is nice that this is in a theme function.
IMO, we need to revisit some older patches, to see if ther is some valuable stuff in OfficeHoursExceptionsFormatter.php
Comment #71
johnvPlease find current situation attached. Files have been renamed and removed.
Before contributing, please update to latest -dev versionn of mail module!
The formatter header 'Exception hours' is now back in the ExceptionsFormatterTable, using code from #70.
Comment #72
johnvComment #73
johnvComment #74
ethomas08 commentedLots of changes -- awesome!
Comment #75
suegmune commentedI just updated to the latest 8.x-1.x-dev from commit 4199465, and now I notice I cannot leave the comments field blank if I leave my start and end times as hour: minute to hour:minute respectively. This used to display Closed automatically but now it gives me an error. If I put "Closed" in the comments field, it works, but as soon as I remove the comment, the error comes back again:
Was this intended, that we must fill in the comment when we are closed on a day?
Comment #76
johnv@suegmune , please try latest dev from 15-sep. I have tested and found that the module works as expected.
Indeed there was some unexpected behaviour because of this ticket.
Comment #78
johnvComment #79
johnvThe Exception days can benefit from the https://schema.org/OpeningHoursSpecification, as provided via #3208978: Add schema.org/OpeningHoursSpecification microdata via Metatag+Token module
Comment #80
ebremner commentedHere is a patch that fixes a lot of issues, also adds a plain text option on field display. It also allows for options under field display for title for exceptions and the date format of the exception. Lastly, it allows for for blank times to be added in exceptions list, which will show as all day, no matter delta it is placed.
Credit should also be given to https://www.drupal.org/u/igorbiki for helping with this patch.
Comment #82
johnv@ebremner, thanks. It seems the patch is not again a stable code. So, the patch is bigger than needed, and I will need some time to evaluate.
Comment #83
johnv@ebremner, your fix for the column header is now committed with attribution in #3260547: Fix Widget column without header.
Comment #85
johnvPlease find attached the resulting patch against today's latest codebase.
Regarding @ebremner's patch. Thanks again for that.
In OfficeHoursExceptionsWidget::extractFormValues, I do not understand the meaning of 'Remove empty slot for exception, which is added automatically'. I did not see a functional difference, so it was not added.
In OfficeHoursList::validateOfficeHoursSlot, I did not apply the special error for exception days. Those should adhere to the same rules as defined in the Field Settings. This is also the case in ~isEmpty().
In OfficeHoursFormatterTrait::formatSlots(), the same. You may have empty hours, but then you must add a comment,e.g., 'open all day', 'only with appointment'.
I did not apply OfficeHoursFormatterTrait.php for the same reason.
Please check the available options in Field settings.
Please check viewElements() for the 'Exception days' title, where the looping logic is different from your patch.
Please check the @todo's in the code.
I still have to assess office-hours.html.twig
Comment #86
johnvComment #87
johnvHmm, patch did not apply. New try.
Comment #88
johnvA reroll against latest code.
- Also: added 'and' label for 'more' slots, like in default widget
- Found a label error in Diff module, commented in @todo
Comment #89
johnvA reroll against the latest code.
A new file Field/FieldType/OfficeHoursExceptionsItem.php is added. Code was moved in there.
The remarks from #84 still apply.
Not sure why the patch keeps getting 'Failed to Apply'.
Comment #92
hswong3i commented@johnv I give a reroll on https://www.drupal.org/files/issues/2022-02-02/office-hours-exceptions-1... manually with MR style, please kindly review ;-)
Comment #93
johnv@hswong3i,
thanks, can you share how to do that?
Comment #94
johnvPlease find a reroll attached.
The patch from @ebremner in #80 made it clear that the module needed some rework to isolate functionality into central functions:
#3262945: Introduce OfficeHoursDateHelper::getLabel()
#3261582: Reorganize isEmpty() and ItemList
It is clear to me that we cannot have a 'clean' Exceptions add-on without touching the main module.
The attached patch adds a new OfficeHoursExceptionsItem.
The central code is already updated with an ItemList::createitem() 'factory', where dynamically a Weekday or Exceptions Item is added.
Regarding #80, #85, the same still applies. Some code is removed from the previous patch since it is now in getLabel().
Comment #95
johnvAnother reroll, making the footprint each time smaller (see other new tickets).
- Regarding the updated 'emplates/office-hours.html.twig' file from #80, see not the reason for change.
- Next stop, trying to rework into third_party_settings.
- Next stop, investigate Smart date module
Comment #96
hswong3i commented@johnv I found the reason why your patch failed to apply: are you creating it with MS Windows? That's the CRLF issue: https://unix.stackexchange.com/a/527230
I give a fix for #95 with `dos2unix` and able to apply it correctly ;-)
Comment #98
johnvThe exceptions are more and more incorporated in the standards module..
Comment #101
johnvA reworked reroll.
As said, I do not like too many formatters/widgets, so the code has now been moved to thrid_party_settings.
I must say, It is not a much cleaner code, but we do not need separate formatters.
In the commits of the latest days some code was centralized in standard code, and was now removed from the exceptions code.
I will leave this to rest, for now.
Comment #102
spadxiii commentedTweaked the patch a tiny little bit: added an 's' to the field type plugin id:
id = "office_hours_exceptions",That way it matches the field widget plugin id.
Comment #103
spadxiii commentedFound a little error in a namespace, that was the actual cause of the config-import-errors I was getting. Fixed in a new patch.
Comment #104
jeffc518 commentedPatch #103 causes a WSOD after saving a node with exceptions.
Drupal 9.39
PHP 7.4
MariaDB 10.4
Steps:
Reinstall office hours module and apply patch via Composer
Structure -> Content Types -> Page -> Manage Form Display - change "Office Hours weekly" to "Office hours weekly with exceptions"
Edit page node - add an exception date / time
Click save - WSOD (node will not save)
Stack trace:
I cleared the cache multiple times, checked for hook_updates() - no dice. Cannot view or edit node, it always gives the same error message as above.
Any ideas? Thanks.
(Edited) Truncated stack trace that was printing out every possible plugin. Was only able to fix by removing the patch and manually removing the database entries in node__field_office_hours and node_revision__field_office_hours.
Comment #105
johnvThe changed plugin ID is renamed in the annotation of this class: /src/Plugin/Field/FieldType/OfficeHoursExceptionsItem.php
but should be changed in OfficeHoursItemList (not in the patch) , line 52:
Comment #106
spadxiii commentedhmm, I missed that one! I'll make a new patch when I get some time (should be around tomorrow morning)
Comment #107
johnvAdding a diff would be helpful, too.
Comment #108
spadxiii commentedFixed the other use of the plugin id and couldn't find any others anymore.
interdiff seems a bit overkill now, but somehow a big chunk has changed places.
Comment #109
spadxiii commentedI'm running into an issue with serializing a node which has an office hours field (with exceptions). We're using entity_activity module to track activity of the admins. This module stores a record with the node serialized to json.
If I add a node and it only has the default days, it serializes just fine. But once I add an exception to it, there's an error while trying to serialize the node.
As a test, I've added a form alter to a custom module in which I do a Node::load and then serialize the results to json using the serializer service. This is the error and trace:
Comment #110
spadxiii commentedOk, it appears to be the exception-handling inside \Drupal\office_hours\Plugin\Field\FieldType\OfficeHoursItemList::createItem
I don't understand why it's done like this?
If I change the line that creates a ListItem to this, the errors seem to be gone:
$exceptions_list = OfficeHoursItemList::createInstance($field_definition, $this->name, $this->parent);Comment #111
spadxiii commentedFound a little bug where the added exceptions would disappear when editing a saved node. Also the 'field_name'-property was missing from the definition, which generated quite a few warnings when saving a node.
Comment #112
johnvRegarding #110:
to enable class overloading, in order to reduce code, I decided to have both items of type OfficeHoursItem ánd OfficeHoursExceptionsItem in the same ItemList.
The 'new' line is just because of lack of knowledge.
I removed reference to '$this->parent', becauase otherwise not ExceptionItems are created, somehow.
Comment #115
johnvPlease test latest DEV version.
The submodule has been removed, since it was nearly empty, and we have a nice switch using the Widget.
Then, it seems that a module cannot create its own ThirdPartySettings, so the settings are moved into the standard settings.
Probably, you need to re-set the Exception settings !!
todo:
- config
- docu
Comment #118
johnvAbove commit added config schema, but there seems some error, according to 'Configuration Inspector' module. Not sure how to fix this.
Comment #120
zenimagine commented@johnv This feature allows you to add exception days. But there should be a button to reverse that. Indeed, for ephemeral shops or events, they are closed all year except on certain days.
Does your patch allow:
- To add exceptional opening days. For stores, for example.
- To add exceptional closing days. For events, for example.
Comment #121
johnv@zenimagine,
The module (or the new patch) does not allow #1743366: [Season Meta] Add "Seasonal Hours / Duration" feature
- To add exceptional opening days.
Yes, you need to set the proper Widget type 'Week (with exceptions). However you can set 'July 4th, 2022', but not 'July, 4th every year'.
- To add exceptional closing days.
Jein, you can allow comments in the widget, then add a comment 'except first Sunday of the month'
I do feel that the Formatter settings need a hint to the separate Widget.
Perhaps you can share a mock-up here, or in #1743366: [Season Meta] Add "Seasonal Hours / Duration" feature, or in a new ticket?
Comment #122
johnvHmm, apprently 'Closed' status avoid that the additional commit is displayed in this thread.
https://git.drupalcode.org/project/office_hours/-/commit/04e14200a903c9a...
Comment #123
johnvDear Audience,
please give your opinion in the ticket #3310038: Exception days: time should be optional
Thanks,