FIX avoid warning if $categories is an id
This commit is contained in:
parent
b77cadf39a
commit
43a47999d7
@ -9135,6 +9135,11 @@ abstract class CommonObject
|
||||
*/
|
||||
public function setCategoriesCommon($categories, $type_categ = '', $remove_existing = true)
|
||||
{
|
||||
// Handle single category
|
||||
if (!is_array($categories)) {
|
||||
$categories = array($categories);
|
||||
}
|
||||
|
||||
dol_syslog(get_class($this)."::setCategoriesCommon Oject Id:".$this->id.' type_categ:'.$type_categ.' nb tag add:'.count($categories), LOG_DEBUG);
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
@ -9144,11 +9149,6 @@ abstract class CommonObject
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Handle single category
|
||||
if (!is_array($categories)) {
|
||||
$categories = array($categories);
|
||||
}
|
||||
|
||||
// Get current categories
|
||||
$c = new Categorie($this->db);
|
||||
$existing = $c->containing($this->id, $type_categ, 'id');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user