- Status changed to RTBC
over 1 year ago 11:55pm 18 March 2023 - π¨π¦Canada nickdickinsonwilde Victoria, BC (T'So-uke lands)
Works good and I think the 86401 is a reasonable value
- π§πͺBelgium BramDriesen Belgium π§πͺ
The only thing we are missing now is an automated test to verify this functionality :)
- ππΊHungary nagy.balint
I also needed this patch.
It seems to work fine!
- π§πͺBelgium xaa Brussels
hi, thank you generalredneck. It seems I also need patch in #10 after a d9.4.8 > d9.5.11 update, possible?
When trying to access a node the patch from #10 solves the error "InvalidArgumentException: Provided value is out of range. in Drupal\time_field\Time::assertInRange() (line 64 of modules/contrib/time_field/src/Time.php)". The node edit page was also broken (impossible to access/edit the node). Should I open a new ticket for this report ? (as it may need more attention and a higher priority level as the error fully broke the access to the /node/xx/edit page).
- Assigned to BramDriesen
- π§πͺBelgium BramDriesen Belgium π§πͺ
I'll be trying to make the tests
- Status changed to Needs work
about 1 year ago 6:33pm 2 November 2023 - π§πͺBelgium BramDriesen Belgium π§πͺ
Just noticed that this patch actually completely bypasses the field validation. If you set the field as required you can simply save without entering any value at all...
- last update
about 1 year ago 7 pass - @bramdriesen opened merge request.
- last update
about 1 year ago 11 pass - Status changed to Needs review
about 1 year ago 8:38pm 2 November 2023 -
BramDriesen β
committed 80005a0b on 2.x
Issue #3074674 by BramDriesen, ccjjmartin, generalredneck,...
-
BramDriesen β
committed 80005a0b on 2.x
- Issue was unassigned.
- Status changed to Fixed
about 1 year ago 8:54pm 2 November 2023 Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
9 months ago 5:07pm 23 February 2024 - π³π±Netherlands Jan-E
After the update from 2.1.0 to 2.1.1 I am getting this error during a cron:
InvalidArgumentException: Provided value is out of range. in Drupal\time_field\Time::assertInRange() (line 64 of modules/contrib/time_field/src/Time.php).
A few lines of the stack trace:
#0 modules/contrib/time_field/src/Time.php(145): Drupal\time_field\Time::assertInRange('86401', 0, 86400)
#1 modules/contrib/time_field/src/Plugin/Field/FieldFormatter/TimeFormatter.php(36): Drupal\time_field\Time::createFromTimestamp('86401')
#2 modules/contrib/time_field/src/Plugin/Field/FieldFormatter/TimeFormatter.php(47): Drupal\time_field\Plugin\Field\FieldFormatter\TimeFormatter->viewValue(Object(Drupal\time_field\Plugin\Field\FieldType\TimeType))Looks like the same error as in #15 β¨ Support empty time range values Fixed . I am running Drupal core 10.2.3.
- π§πͺBelgium BramDriesen Belgium π§πͺ
@Jan-E What is the value you're trying to submit?
- π³π±Netherlands Jan-E
@BramDriessen I really would not know. It also happened when a cron was invoked from outside the site.
- π³π±Netherlands Jan-E
This was the first time it happened, on a time that almost nothing was done on the site:
- π§πͺBelgium BramDriesen Belgium π§πͺ
I've been testing this for a bit but I can't seem to reproduce it :/ if you would happen to be able to debug a bit and see what the values are/where they come from that would help.
- π³π±Netherlands Jan-E
@BramDriesen thanks for getting back on this.
I just had this once again. Somehow the exact value 86401 gets entered in a time field. When cron runs it apparently tries to clear up the entity cache and falls into the error.
The previous occasion I remedied it by manually deleting the field instance and the revision instance from the database. I will try to change the value into 86400 now. And will try to find out how users manage to enter 86401.
- π§πͺBelgium BramDriesen Belgium π§πͺ
I think there is someone else with a similar issue in π After 2.1.1 update all time fields are treated as required; empty values not accepted. Postponed: needs info