commit 391c4c6fd8a7461c98c509e08aeab5e847aab355
parent d2318190a528c155e4d35fabe3d0cd9e8e76fd84
Author: Jan Dankert <develop@jandankert.de>
Date: Wed, 11 Dec 2019 21:49:35 +0100
Fix: Setting the correct base object for text actions.
Diffstat:
3 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/modules/cms-core/action/FileAction.class.php b/modules/cms-core/action/FileAction.class.php
@@ -33,9 +33,8 @@ use ValidationException;
/**
* Action-Klasse zum Bearbeiten einer Datei
- * @author $Author$
- * @version $Revision$
- * @package openrat.actions
+ *
+ * @author Jan Dankert
*/
class FileAction extends ObjectAction
{
@@ -44,7 +43,7 @@ class FileAction extends ObjectAction
/**
* @var File
*/
- protected $file;
+ private $file;
/**
* Konstruktor
diff --git a/modules/cms-core/action/PageAction.class.php b/modules/cms-core/action/PageAction.class.php
@@ -394,7 +394,7 @@ class PageAction extends ObjectAction
$this->setTemplateVar( 'alias_filename', $alias->filename );
$this->setTemplateVar( 'alias_folderid', $alias->parentid );
- $project = Project::create( $this->baseObject->projectid );
+ $project = Project::create( $this->page->projectid );
$this->setTemplateVar( 'folders' , $project->getAllFlatFolders() );
}
diff --git a/modules/cms-core/action/TextAction.class.php b/modules/cms-core/action/TextAction.class.php
@@ -39,7 +39,7 @@ namespace cms\action
{
public $security = Action::SECURITY_USER;
- var $text;
+ private $text;
/**
* Konstruktor
@@ -56,12 +56,12 @@ namespace cms\action
$text = new Text($this->getRequestId());
$text->load();
- $this->setBaseObject(text);
+ $this->setBaseObject( $text );
}
- protected function setBaseObject($text ) {
+ protected function setBaseObject( $text ) {
$this->text = $text;
@@ -71,26 +71,34 @@ namespace cms\action
public function valuePost()
{
- $this->file->value = $this->getRequestVar('value', OR_FILTER_RAW);
- $this->file->saveValue();
+ $this->text->value = $this->getRequestVar('value', OR_FILTER_RAW);
+ $this->text->saveValue();
- $this->addNotice($this->file->getType(), $this->file->name, 'VALUE_SAVED', 'ok');
- $this->file->setTimestamp();
+ $this->addNotice($this->text->getType(), $this->text->name, 'VALUE_SAVED', 'ok');
+ $this->text->setTimestamp();
}
+ /**
+ * Only needed because there is a special template for text nodes.
+ */
public function valueView()
{
parent::valueView();
}
+ /**
+ * Only needed because there is a special template for text nodes.
+ */
public function showView() {
- $this->file = $this->text;
parent::showView();
}
+ /**
+ * Only needed because there is a special template for text nodes.
+ */
public function previewView()
{
parent::previewView();