openrat-cms

OpenRat Content Management System
git clone http://git.code.weiherhei.de/openrat-cms.git
Log | Files | Refs

commit 5c1548f56a6724218265a3edc578d864b75ade5f
parent 6715913059768931af109d70d71a7cba874c9927
Author: Jan Dankert <develop@jandankert.de>
Date:   Fri, 25 Sep 2020 01:01:41 +0200

Fix: The templatemodel source must be not null.

Diffstat:
modules/cms/model/TemplateModel.class.php | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/cms/model/TemplateModel.class.php b/modules/cms/model/TemplateModel.class.php @@ -114,14 +114,15 @@ class TemplateModel extends ModelBase $stmt = Db::sql('SELECT MAX(id) FROM {{templatemodel}}'); $nextid = intval($stmt->getOne())+1; - $stmt = $db->sql( 'INSERT INTO {{templatemodel}}'. - ' (id,templateid,projectmodelid,extension) '. - ' VALUES ({id},{templateid},{modelid},{extension}) '); + $stmt = Db::sql( 'INSERT INTO {{templatemodel}}'. + ' (id,templateid,projectmodelid,extension,text) '. + ' VALUES ({id},{templateid},{modelid},{extension},{src}) '); $stmt->setInt ( 'id',$nextid ); $stmt->setString( 'extension' ,$this->extension ); $stmt->setInt ( 'templateid' ,$this->templateid ); $stmt->setInt ( 'modelid' ,$this->modelid ); + $stmt->setString( 'src' ,$this->src ); $stmt->query();