diff options
author | William Desportes <williamdes@wdes.fr> | 2018-11-30 13:27:34 +0300 |
---|---|---|
committer | William Desportes <williamdes@wdes.fr> | 2018-11-30 13:29:31 +0300 |
commit | cc2b1c8b9919ae67115366bb1a80c697bbd18944 (patch) | |
tree | 2c43354b443d28508cf86ea3597b741fbebbc1c1 | |
parent | 84e99092eef9fc83b4563e12c4ca66ddf47601f2 (diff) |
Fix #14352 - JavaScript errors with Designer
Closes: #14352
Signed-off-by: William Desportes <williamdes@wdes.fr>
-rw-r--r-- | libraries/classes/Database/Designer/Common.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libraries/classes/Database/Designer/Common.php b/libraries/classes/Database/Designer/Common.php index 562d35d1df..8f3e1ad31e 100644 --- a/libraries/classes/Database/Designer/Common.php +++ b/libraries/classes/Database/Designer/Common.php @@ -302,7 +302,7 @@ class Common * * @param int $pg pdf page id * - * @return string table name + * @return string|null table name */ public function getPageName($pg) { @@ -322,7 +322,7 @@ class Common DatabaseInterface::CONNECT_CONTROL, DatabaseInterface::QUERY_STORE ); - return count($page_name) ? $page_name[0] : null; + return ( is_array($page_name) && isset($page_name[0]) ) ? $page_name[0] : null; } /** @@ -370,7 +370,7 @@ class Common { $cfgRelation = $this->relation->getRelationsParam(); if (! $cfgRelation['pdfwork']) { - return null; + return -1; } $query = "SELECT `page_nr`" @@ -387,7 +387,7 @@ class Common DatabaseInterface::QUERY_STORE ); - if (isset($default_page_no) && count($default_page_no)) { + if (is_array($default_page_no) && isset($default_page_no[0])) { return intval($default_page_no[0]); } return -1; @@ -405,7 +405,7 @@ class Common { $cfgRelation = $this->relation->getRelationsParam(); if (! $cfgRelation['pdfwork']) { - return null; + return -1; } $page_no = -1; @@ -426,7 +426,7 @@ class Common DatabaseInterface::CONNECT_CONTROL, DatabaseInterface::QUERY_STORE ); - if (isset($min_page_no[0]) && count($min_page_no[0])) { + if (is_array($min_page_no) && isset($min_page_no[0])) { $page_no = $min_page_no[0]; } } |