From 640e03422f82a52e827f670bcafa7b51a35a9e8a Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 3 Oct 2010 13:13:41 +0000 Subject: [PATCH] Fix: problem with next/preview function --- htdocs/core/class/commonobject.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 88e86d5129a..2963b92eb16 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1226,14 +1226,17 @@ class CommonObject * Load type of canvas of an object * @param id element id */ - function getCanvas($id) + function getCanvas($id=0,$ref='') { global $conf; + + $ref = trim($ref); $sql = "SELECT rowid, canvas"; $sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element; $sql.= " WHERE entity = ".$conf->entity; - $sql.= " AND rowid = ".$id; + if (!empty($id)) $sql.= " AND rowid = ".$id; + if (!empty($ref)) $sql.= " AND ref = '".$ref."'"; $resql = $this->db->query($sql); if ($resql)