Closed (fixed)
Project:
Drupal core
Version:
8.6.x-dev
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
21 Feb 2016 at 22:48 UTC
Updated:
4 Mar 2019 at 18:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
cilefen commentedPlease update the issue summary with the steps needed to reproduce the bug. We must understand the conditions that cause the notice. Please use the issue template.
Comment #3
elandirayan commentedAdding the Patch for the fix.
Comment #4
elandirayan commentedComment #5
cilefen commentedThank you for posting this patch, however you are using the wrong status. We still need the issue summary updated it to understand what situation causes this error.
Comment #6
shahgm commentedI reset my code by removing fix and not passing default value from my custom code as before to reproduce the error. However, i couldn't reproduce the error. I am sure it's a good idea to check if default_value index is set or not before accessing it's value. Right? I don't know if there is process before this checking for it or not, but this valueCallback function is not checking for sure.
Thanks,
Shah.
Comment #7
shahgm commentedoh i show it... form loads fine, but if you go to error log it shows error right there... So, to reproduce you do is create form field without specifying default value in it...
$form['datetime'] = array(
'#type' => 'datetime',
'#title' => t('Downtime DateTime'),
);
and check error log ...
Thanks,
Shah
Comment #8
elandirayan commentedHi,
I have contacted Shah, who created bug and updated info and tested with the patch and it is working fine. please review and mark it as fixed.
Thanks
Elan
Comment #9
elandirayan commentedComment #14
rijidij commentedThis issue is over 2 years old. Will it be committed to core?
I've re-rolled the patch for 8.4.
Comment #17
ethomas08 commentedI tested the patch in #14 on a clean install of Drupal 8.6 and it works. No more warning showing up in the logs after applying the patch.
Comment #18
amateescu commentedThe patch looks good, we just need to fix one thing before it can be committed:
According to our coding standards,
nullneeds to be upper case.Comment #19
krzysztof domańskiComment #20
amateescu commentedPerfect :)
Comment #21
larowlanSorry, if this is a bug and we're fixing a regression, we need a test
Comment #22
alexpottI agree with @larowlan we need a test.
Comment #23
ilya.no commentedAttaching patch with test.
Comment #25
ilya.no commentedFixed typo.
Comment #26
amateescu commentedThe test case should be added to the existing
\Drupal\KernelTests\Core\Datetime\DatetimeElementFormTesttest class.Comment #27
vj commentedPlease review and let me know if any changes required.
Comment #29
vj commentedComment #31
amateescu commentedLooks great!
Comment #32
krzysztof domańskiI think we should add a comment describing what we are testing in this form element. In the future, we will not know for what purpose this element has been added.
Comment #33
amateescu commentedAgreed, that comment is very useful.
Comment #34
alexpottCrediting @larowlan and @amateescu for patch review. Crediting @shahgm for creating the issue.
Committed ea33b15 and pushed to 8.7.x. Thanks!
Doesn't apply to 8.6.x so have only fixed 8.7.x. If someone wants to backport then this would be eligible.
Comment #35
alexpottComment #38
dwwFound this via #2419131-93: [PP-1] #states attribute does not work on #type datetime
Backporting this would be trivial if #2992580: Custom callbacks doesn't work was also in 8.6.x, since that's where the test class this patch is extending was first added.
With 2992580-09.patch applied to 8.6.x, this patch applies (with minor fuzz).
Can we get #2992580 in and then I'll upload a backport here? I queued a re-test of that against 8.6.x, and I'll RTBC once the bot is happy.
Thanks!
-Derek
Comment #39
dwwYay, @alexpott just committed #2992580: Custom callbacks doesn't work to 8.6.x, and now #32 applies cleanly, and core/tests/Drupal/KernelTests/Core/Datetime/DatetimeElementFormTest.php passes locally.
RTBC.
Thanks!
-Derek
Comment #41
dwwBot is confused. #32 is all green for 8.6.x.
Comment #42
dwwAccording to @drumm in Slack, the bot will continue to be confused until a new file is uploaded in this case. :/ So here's #32 again, so we don't keep getting this marked 'needs work' each day it isn't backported.
Comment #44
alexpottCherry-picked the 8.7.x back to 8.6.x
Comment #45
dwwThanks!