- 🇺🇸United States benjifisher Boston area
I am adding steps to reproduce the bug to the issue summary. I used the steps in 🐛 DateTime::createFromFormat() expects parameter 2 to be string Closed: duplicate and #3052608-8: DateTimeComputed tries to compute from an empty value → as a starting point.
I am pretty sure that this issue and 🐛 DateTime::createFromFormat() expects parameter 2 to be string Closed: duplicate are duplicates. The other issue was created first and has a better description of how to reproduce the bug. This issue has a better explanation of what goes wrong. Each issue has a patch, and they change different parts of the process.
- 🇨🇦Canada igorbiki
Patch #2 works for me. Used with paragraphs in a custom block.
48:19 44:47 Running- 🇫🇮Finland sonyavpaa
Implemented patch #2 and works great with latest Paragraphs 1.17 & Drupal core 10.2.7!
- 🇺🇸United States jldust
Confirming that patch #2 works cleanly on Drupal 10.3.2 with Paragraphs v1.18. Does this change need tests to be updated?
- Status changed to Needs work
7 months ago 3:32am 12 September 2024 - Merge request !9482Issue #3313231: Update DateTimeComputed.php to address Fatal error when Ajax call form → (Open) created by jldust
- 🇺🇸United States jldust
I've created a MR with the patch applied, I'm new to test writing so I'm not sure where to start for this specific issue. If there is a specific guide page I would be happy to look at it!
- First commit to issue fork.
- 🇳🇱Netherlands eelkeblok Netherlands 🇳🇱
That last commit was me. I did it through the web interface, so that's probably the reason it doesn't properly show up.
From my limited testing, I noticed that only when the field is empty, the value will indeed be an array. I think the solution from the previous patch is than in fact not quite appropriate; it just takes one of the empty values and passes it through the test of the code. Instead, I changed it to treat it similarly to a NULL value; just bail out when it is an array.
Still needs a test, of course :)