Does anyone know what the problem is. Am I doing something wrong? Any suggestions?

I'm getting this warning when I turn on freetagging on image nodes. Here's what I do:
1) go to administer/categories and add a new vocabulary called Tags. I select image under type, disable hierarchy, freetagging checked.
2) create an image node and put cute within the Tags field.
3) when I press submit I get the warning.

print_r($array) gives Array ( [2] => 0 [tags] => Array ( [21] => cute ) ) and so is probably complaining about the subarray. Here's the code:
function drupal_map_assoc($array, $function = NULL) {
if (!isset($function)) {
$result = array();
foreach ($array as $value) {
$result[$value] = $value; errors out here which makes sense
}
return $result;
}
elseif (function_exists($function)) {
$result = array();
foreach($array as $value) {
$result[$value] = $function($value);
}
return $result;
}
}

Here's the stack trace:
function drupal_map_assoc( Array )
{
file: C:\Program Files\xampp\htdocs\drupal47\includes\form.inc
line: 362
}

was called by:
function form_builder( image_node_form, Array )
{
file: C:\Program Files\xampp\htdocs\drupal47\includes\form.inc
line: 445
}

was called by:
function form_builder( image_node_form, Array )
{
file: C:\Program Files\xampp\htdocs\drupal47\includes\form.inc
line: 445
}

was called by:
function form_builder( image_node_form, Array )
{
file: C:\Program Files\xampp\htdocs\drupal47\includes\form.inc
line: 120
}

was called by:
function drupal_get_form( image_node_form, Array, node_form )
{
file: C:\Program Files\xampp\htdocs\drupal47\modules\node.module
line: 1586
}

was called by:
function node_form( Array )
{
file: C:\Program Files\xampp\htdocs\drupal47\modules\node.module
line: 1736
}

was called by:
function node_add( image )
{
file: C:\Program Files\xampp\htdocs\drupal47\modules\node.module
line: 2043
}

was called by:
function node_page( image )
{
file:
line:
}

was called by:
function call_user_func_array( node_page, Array )
{
file: C:\Program Files\xampp\htdocs\drupal47\includes\menu.inc
line: 418
}

was called by:
function menu_execute_active_handler( )
{
file: C:\Program Files\xampp\htdocs\drupal47\index.php
line: 15
}

Comments

bdragon’s picture

Status: Active » Closed (fixed)

This was likely fixed by a later 4.7.x...