diff --git a/controllers/d.poi.php b/controllers/d.poi.php index 8b363a7..a267518 100755 --- a/controllers/d.poi.php +++ b/controllers/d.poi.php @@ -20,7 +20,7 @@ switch ($controller->splitted_url[1]) { $poi->author = $user->id; $poi->source = "kab"; $poi->is_commentable = isset($_POST['is_commentable'])?'t':'f'; - $poi->parameters = ''; + $poi->parameters = new \stdClass(); if(!$poi->checkPermalink($_POST['permalink'],1)) { $poi->permalink = $_POST['permalink']; $poi->insert(); diff --git a/models/d.poi.php b/models/d.poi.php index b08a04e..9113117 100755 --- a/models/d.poi.php +++ b/models/d.poi.php @@ -111,12 +111,12 @@ class Poi pg_query($con, "BEGIN"); - $query = "INSERT INTO contents (is_commentable, is_public, permalink, creation_date, name, type, poi_type) VALUES - ($1, TRUE, $2, $3, $4, $5, $6) RETURNING id"; + $query = "INSERT INTO contents (is_commentable, is_public, permalink, creation_date, type, poi_type) VALUES + ($1, TRUE, $2, $3, $4, $5) RETURNING id"; pg_prepare($con, "prepare1", $query) or die ("Cannot prepare statement\n"); - $result = pg_execute($con, "prepare1", array($this->is_commentable, $this->permalink, date('r'), $this->name, $this->type, $this->poi_type)) + $result = pg_execute($con, "prepare1", array($this->is_commentable, $this->permalink, date('r'), $this->type, $this->poi_type)) or die ("Cannot execute statement\n"); $this->content_id = pg_fetch_assoc($result)['id'];