From 3833ac5c832861cd263301fe4cbf2ddcd725ecf5 Mon Sep 17 00:00:00 2001 From: xevidos Date: Mon, 30 Mar 2020 14:16:28 -0400 Subject: [PATCH] Fixed missing user in active, Added removal of missed constraint before changing project column --- components/active/class.active.php | 2 +- components/sql/class.sql.php | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/components/active/class.active.php b/components/active/class.active.php index 2dcb202..c1eb8f3 100755 --- a/components/active/class.active.php +++ b/components/active/class.active.php @@ -101,7 +101,7 @@ class Active extends Common { foreach( $result as $id => $data ) { array_push( $users, $data["user"] ); - if( $data["user"] == $_SESSION ) { + if( $data["user"] == $_SESSION["user"] ) { $user = true; break; diff --git a/components/sql/class.sql.php b/components/sql/class.sql.php index 4ff9c1d..92de7f5 100755 --- a/components/sql/class.sql.php +++ b/components/sql/class.sql.php @@ -359,6 +359,21 @@ class sql { ); } + try { + + $projects = $this->query( array( + "mysql" => "ALTER TABLE projects DROP INDEX project_path;", + "pgsql" => "ALTER TABLE projects DROP CONSTRAINT project_path;", + ), array(), 0, "rowCount", "exception" ); + } catch( Exception $error ) { + + //echo var_dump( $error->getMessage() ); + $status_updates["path_owner_constraint"] = array( + "error_message" => $error->getMessage(), + "dev_message" => "Removal of project_path constraint in the projects table failed. This usually means there was never one to begin with" + ); + } + try { $convert = false;