Project

General

Profile

Actions

Bug #25034

closed

Argument #1 is not an array in t3lib/class.t3lib_tcemain.php

Added by Sebastian Wagner almost 14 years ago. Updated almost 14 years ago.

Status:
Closed
Priority:
Should have
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2011-02-14
Due date:
% Done:

0%

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

Description

Hi, in t3lib_TCEmai::process_datamap() i'm getting

PHP Warning: array_merge(): Argument #1 is not an array in t3lib/class.t3lib_tcemain.php line 1137

$data = array('tt_news' => array('foo123' => array(
'title' => "game",
'author' => '',
'author_email' => '',
'short' => "a",
'bodytext' => "looongtext",
'keywords' => '',
'hidden' => 0,
'datetime' => 1297688403,
'pid' => 4,
'type' => 0,
'image' => '',
'category' => '',
)));
$tcemain = t3lib_div::makeInstance('t3lib_TCEmain');
$tcemain->dontProcessTransformations = 1;
$tcemain->stripslashes_values = 0;
$tcemain->start($data, array());
$tcemain->process_datamap();
echo "
"; print_r($tcemain->substNEWwithIDs); die("
");

call it like this:
$data = array('tt_news' => array('foo123' => array(
'title' => "game",
'author' => '',
'author_email' => '',
'short' => "a",
'bodytext' => "looongtext",
'keywords' => '',
'hidden' => 0,
'datetime' => 1297688403,
'pid' => 4,
'type' => 0,
'image' => '',
'category' => '',
)));
$tcemain = t3lib_div::makeInstance('t3lib_TCEmain');
$tcemain->dontProcessTransformations = 1;
$tcemain->stripslashes_values = 0;
$tcemain->start($data, array());
$tcemain->process_datamap();
echo "

"; print_r($tcemain->substNEWwithIDs); die("
");
(issue imported from #M17580)

Actions #1

Updated by Björn Pedersen almost 14 years ago

if the 'foo123' is really present, then that is the reason for the error:
From reading the code it should either be a valid uid (integer) or the string 'NEW'.

Actions #2

Updated by Steffen Gebert almost 14 years ago

Sebastian, does this solve your problem?

Actions #3

Updated by Sebastian Wagner almost 14 years ago

for strings created with

uniqid('NEW');

it works fine.

thanks alot Björn

Actions

Also available in: Atom PDF