Skip to content

Commit

Permalink
Item::saveMetatext() was broken
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskelly committed Oct 11, 2007
1 parent b4ee76a commit d0e0ad4
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions application/models/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,16 +284,19 @@ public function saveMetatext($post)
{
$table = Doctrine_Manager::getInstance()->getTable('Metatext');

//Save the metatext that was posted
$posted = $table->collectionFromArray($post, $this);
$posted->save();
if($post) {
//Save the metatext that was posted
$posted = $table->collectionFromArray($post, $this);
$posted->save();
}

//Save the metatext that was set elsewhere
$mt = $this->_metatextToSave;

$other = $table->collectionFromArray($mt, $this);
$other->save();

if($mt) {
$other = $table->collectionFromArray($mt, $this);
$other->save();
}
}

public function hasThumbnail()
Expand Down Expand Up @@ -622,10 +625,7 @@ protected function onFormError($post, $options=array())

public function postSave()
{
if(!empty($_POST['metafields']))
{
$this->saveMetatext($_POST['metafields']);
}
$this->saveMetatext($_POST['metafields']);
parent::postSave();
}

Expand Down

0 comments on commit d0e0ad4

Please sign in to comment.