Bug #24276
closedPHP Warning may occur in backend UI with recent PHP version
0%
Description
The following PHP Warning occurs on my PHP installation :
PHP Warning
PHP Warning: date() expects parameter 2 to be long, string given in typo3_src-4.4.4/t3lib/class.t3lib_tceforms.php line 3026
See also screenshot attached.
It could appear in any screen since the problem is located in class /typo3_src-4.4.4/t3lib/class.t3lib_tceforms.php
The bug is due to a bad type specification on the second parameter of function formatValue ($config, $itemValue) which is being specified as a string while it should be an int.
Changing the comment above the function definition fixes the problem.
(issue imported from #M16651)
Files
Updated by Steffen Ritter almost 14 years ago
just to be sure: changing a doc-comments stops showing a php warning?
Updated by Alban Cousinie almost 14 years ago
Ho no sorry. I made a double check this morning and it has no influence (I quickly thought it had because in flow3 these are actually interpreted). When I tested this fix, the bug did not reappear because I forgot to uncomment another line.
A fix that works is to make sure $itemvalue has the good type by casting it to the atttended type on the first line of the function :
function formatValue ($config, $itemValue) {
$itemValue = (int)$itemValue; //$itemValue is due to be a timestamp
...
}
No more warnings with this fix.
Updated by Chris topher about 13 years ago
Making sure it is an integer, is a good idea. We did the same in #30931, which is about the same kind of problem.
Updated by Alexander Opitz over 11 years ago
As #30931 is resolved, can this issue be closed?
Updated by Christian Kuhn about 11 years ago
- Status changed from Needs Feedback to Closed
- Is Regression set to No
dupe.