From 4cbae2be2e063b5835a6edef5d9a0c036c09b4d4 Mon Sep 17 00:00:00 2001 From: icewing Date: Mon, 21 Apr 2008 14:44:35 +0000 Subject: Marcus Povey * Numerous bugs fixed git-svn-id: https://code.elgg.org/elgg/trunk@503 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/filestore.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'engine/lib/filestore.php') diff --git a/engine/lib/filestore.php b/engine/lib/filestore.php index ab295e390..ba370d557 100644 --- a/engine/lib/filestore.php +++ b/engine/lib/filestore.php @@ -240,6 +240,8 @@ { parent::__construct($guid); + // Set default filestore + $this->filestore = $this->getFilestore(); } /** @@ -268,7 +270,7 @@ */ public function open($mode) { - if (!$this->name) + if (!$this->title) throw new IOException("You must specify a name before opening a file."); // See if file has already been saved @@ -394,7 +396,7 @@ $parameters[$name] = $meta->value; } } - + // If parameters loaded then create new filestore if (count($parameters)!=0) { @@ -421,13 +423,15 @@ if (!parent::save()) return false; + // Get filestore if necessary + // Save datastore metadata $params = $this->filestore->getParameters(); foreach ($params as $k => $v) $this->setMetaData("filestore::$k", $v); // Now make a note of the filestore class - $this->setMetaData("filestore::filestore", get_class($this)); + $this->setMetaData("filestore::filestore", get_class($this->filestore)); return true; } -- cgit v1.2.3