Project

General

Profile

Actions

Bug #24276

closed

PHP Warning may occur in backend UI with recent PHP version

Added by Alban Cousinie almost 14 years ago. Updated about 11 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2010-12-02
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.4
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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

t3bug.jpg (395 KB) t3bug.jpg Administrator Admin, 2010-12-02 16:35

Related issues 1 (0 open1 closed)

Is duplicate of TYPO3 Core - Bug #30931: date() expects parameter 2 to be long, string given in class.tslib_content.phpClosed2011-10-14

Actions
Actions #1

Updated by Steffen Ritter almost 14 years ago

just to be sure: changing a doc-comments stops showing a php warning?

Actions #2

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.

Actions #3

Updated by Chris topher about 13 years ago

  • Target version deleted (0)
Actions #4

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.

Actions #5

Updated by Alexander Opitz over 11 years ago

As #30931 is resolved, can this issue be closed?

Actions #6

Updated by Christian Kuhn about 11 years ago

  • Status changed from Needs Feedback to Closed
  • Is Regression set to No

dupe.

Actions

Also available in: Atom PDF