Erreur de type Warning: in_array() [function.in-array]
Posté : 02 juin 2008, 22:31
Bonjour à tous,
Je fais appel à vous, grand maitre du Php
, pour résoudre un problème sur lequelle je suis depuis un bon moment et qui me rend fou
J'ai un site qui utilise Oscommerce.
J'ai installé une contribution appelé "order editor". Tout fonctionne parfaitement mise à part le fait que j'ai une page d'erreur à un moment donnée
Voici l'erreur que j'ai :
Voici la ligne 423 de edit_orders.php :
Voila une partie de code de general.php. La ligne 86 correspond à :
Pouvez-vous m'aider à solutionner le problème?
Le pire dans tout ca, c'est que quand j'ai l'erreur qui s'affiche et que je fait un retour à la page précédente, les informations ont bien été mise à jour.
Si vous avez besoin d'autres infos n'hesitez pas. Merci pour votre aide
Je fais appel à vous, grand maitre du Php
J'ai un site qui utilise Oscommerce.
J'ai installé une contribution appelé "order editor". Tout fonctionne parfaitement mise à part le fait que j'ai une page d'erreur à un moment donnée
Voici l'erreur que j'ai :
Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/xxxxxxxx/public_html/adminxxxxx/edit_orders.php on line 423
Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/xxxxxxxxx/public_html/adminxxxxx/edit_orders.php on line 423
Warning: Cannot modify header information - headers already sent by (output started at /home/xxxxxxx/public_html/adminxxxxxx/edit_orders.php:423) in /home/xxxxxxxx/public_html/adminxxxxx/includes/functions/general.php on line 86
Voici la ligne 423 de edit_orders.php :
if ( (!in_array($ot_class, $written_ot_totals_array)) && (!in_array($ot_title, $written_ot_titles_array)) && (tep_not_null($ot_value)) && (tep_not_null($ot_title)) && ($ot_class != 'ot_tax') && ($ot_class != 'ot_loworderfee') ) { //7
Voici la ligne 423 avec une partie de code autour : } elseif ($new_ot_total) { //also within 6
$order->info['total'] += ($order_totals[$i]['value']*(-1));
$current_ot_totals_array[] = $order_totals[$i]['code'];
$written_ot_totals_array[] = $ot_class;
$written_ot_titles_array[] = $ot_title;
}//end 6
}//end 4
} elseif ( (tep_not_null($ot_value)) && (tep_not_null($ot_title)) ) { // this modifies if (!strstr($ot_class, 'ot_custom')) { //3
$new_order_totals[] = array('title' => $ot_title,
'text' => $currencies->format($ot_value, true, $order->info['currency'], $order->info['currency_value']),
'value' => $ot_value,
'code' => 'ot_custom_' . $j,
'sort_order' => $j);
$order->info['total'] += $ot_value;
$written_ot_totals_array[] = $ot_class;
$written_ot_titles_array[] = $ot_title;
$j++;
} //end 3
//save ot_skippy from certain annihilation
if ( (!in_array($ot_class, $written_ot_totals_array)) && (!in_array($ot_title, $written_ot_titles_array)) && (tep_not_null($ot_value)) && (tep_not_null($ot_title)) && ($ot_class != 'ot_tax') && ($ot_class != 'ot_loworderfee') ) { //7
//this is supposed to catch the oddball components that don't show up in $order_totals
$new_order_totals[] = array(
'title' => $ot_title,
'text' => $currencies->format($ot_value, true, $order->info['currency'], $order->info['currency_value']),
'value' => $ot_value,
'code' => $ot_class,
'sort_order' => $j);
//$current_ot_totals_array[] = $order_totals[$i]['code'];
//$current_ot_titles_array[] = $order_totals[$i]['title'];
$written_ot_totals_array[] = $ot_class;
$written_ot_titles_array[] = $ot_title;
$j++;
} //end 7
Voila une partie de code de general.php. La ligne 86 correspond à :
header('Location: ' . $url);
// Redirect to another page or site
function tep_redirect($url) {
global $logger;
if ( (strstr($url, "\n") != false) || (strstr($url, "\r") != false) ) {
tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));
}
header('Location: ' . $url);
if (STORE_PAGE_PARSE_TIME == 'true') {
if (!is_object($logger)) $logger = new logger;
$logger->timer_stop();
}
exit;
}
////
Pouvez-vous m'aider à solutionner le problème?
Le pire dans tout ca, c'est que quand j'ai l'erreur qui s'affiche et que je fait un retour à la page précédente, les informations ont bien été mise à jour.
Si vous avez besoin d'autres infos n'hesitez pas. Merci pour votre aide