1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 06:38:00 +02:00

PHP 5.6 fix for sql function queries.

This commit is contained in:
Cameron
2017-03-28 17:55:35 -07:00
parent 2b37a57348
commit 453a7fc91e

View File

@@ -4174,9 +4174,14 @@ class e_admin_controller_ui extends e_admin_controller
$pid = $this->getPrimaryName(); $pid = $this->getPrimaryName();
$order = $this->getSortField(); $order = $this->getSortField();
$sql = "
DROP FUNCTION IF EXISTS `getDepth` ;
$sql = "DROP FUNCTION IF EXISTS `getDepth` ;";
e107::getDb()->gen($sql);
$sql = "
CREATE FUNCTION `getDepth` (project_id INT) RETURNS int CREATE FUNCTION `getDepth` (project_id INT) RETURNS int
BEGIN BEGIN
DECLARE depth INT; DECLARE depth INT;
@@ -4197,10 +4202,15 @@ class e_admin_controller_ui extends e_admin_controller
END END
; ;
";
e107::getDb()->gen($sql);
DROP FUNCTION IF EXISTS `getTreeSort`; $sql = "DROP FUNCTION IF EXISTS `getTreeSort`;";
e107::getDb()->gen($sql);
$sql = "
CREATE FUNCTION getTreeSort(incid INT) CREATE FUNCTION getTreeSort(incid INT)
RETURNS CHAR(255) RETURNS CHAR(255)
BEGIN BEGIN
@@ -4219,7 +4229,6 @@ class e_admin_controller_ui extends e_admin_controller
"; ";
// FIXME - make order work correctly (modify @order) when twin digits or higher are used.
e107::getDb()->gen($sql); e107::getDb()->gen($sql);