diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 0f37edaf398..0f927f3a6e9 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -703,8 +703,8 @@ if (empty($reshook)) { $object->setCategories($categories); if (!empty($backtopage)) { - $backtopage = preg_replace('/__ID__/', $object->id, $backtopage); // New method to autoselect parent project after a New on another form object creation - $backtopage = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $backtopage); // New method to autoselect parent after a New on another form object creation + $backtopage = preg_replace('/__ID__/', (string) $object->id, $backtopage); // New method to autoselect parent project after a New on another form object creation + $backtopage = preg_replace('/--IDFORBACKTOPAGE--/', (string) $object->id, $backtopage); // New method to autoselect parent after a New on another form object creation if (preg_match('/\?/', $backtopage)) { $backtopage .= '&productid='.$object->id; // Old method }