- Issue created by @ebremner
- 🇳🇱Netherlands johnv
Please check dev. It must be solved. If so, i Will create a New release asap.
- 🇳🇱Netherlands johnv
Ok, I misread your post.
you have no yrouble with the data, but only with the title of the aunday weekday. Correct?BTW, please Share your field setting. I do not know how you get the HTML5 ampm output. I cannot reproduceren that.
- 🇨🇭Switzerland pvbergen
We encountered the same problem after upgrading to 1.9. from 1.8 in several of our projects.
Comparing the database backups before and after the upgrade shows a change in the field tables (node__field_ZZZ, node_revision__field_ZZZ) on column `field_ZZZ_day`.Before update
After update
This happens for all revisions, so I assume office_hours_update_8005 is the cause.
My working theory is that updating the schema update somehow causes to misalign the indexing and causing it to shift.
I'm not sure how exactly this would happen, though.Quick fix
For now, we could resolve the issue by downgrading to 1.8 and reset/manually re-enter the values from the backup.
This seems to work reliably. - 🇨🇭Switzerland pvbergen
Ignore my previous comment about the update hook. The data changes only after saving the node with 1.9.
The update hook does not change the values in the database. - 🇨🇭Switzerland pvbergen
After digging through the code I found the issue and provided a fix in the MR.
OfficeHoursItem::formatValue checks whether the day within the data is valid and is called in OfficeHoursItem::setValue.
In 1.9 there was code introduced to handle exception days: https://git.drupalcode.org/project/office_hours/-/compare/8.x-1.8...8.x-...On the above line, it checks whether $day is an exception from the schedule.
Unfortunately,((int) 0 == 'exception_day_delta') === TRUE
, setting$day = $previous_day; // $previous_day = 6
and thus making all sundays into saturdays.I've manually testet that changing this to
(int) 0 === 'exception_day_delta'
resolves the issue for us.As this causes data corruption/loss I increase the priority to "Critical".
- Open on Drupal.org →Core: 10.0.7 + Environment: PHP 8.1 & MySQL 5.7last update
over 1 year ago Waiting for branch to pass - @pvbergen opened merge request.
- Status changed to Needs review
over 1 year ago 4:42pm 6 June 2023 -
johnv →
committed a117160d on 8.x-1.x authored by
pvbergen →
Issue #3363013 by pvbergen, ebremner: Day 0 missing in 1.9 on PHP8
-
johnv →
committed a117160d on 8.x-1.x authored by
pvbergen →
- Status changed to Fixed
over 1 year ago 4:45pm 6 June 2023 - 🇳🇱Netherlands johnv
Thanks for the fix. apparently, I am still developing on PHP7.
@Eric, please confirm that dev now works fine.
- 🇨🇦Canada ebremner
Hey it works now, thanks for the quick fix. Are you going re-release 1.9 or make a 1.10 release?
Thanks!!
Automatically closed - issue fixed for 2 weeks with no activity.