Skip to content

Commit

Permalink
Update MetaHelper.php
Browse files Browse the repository at this point in the history
  • Loading branch information
creecros committed Sep 12, 2018
1 parent 3cbba35 commit 748b898
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Helper/MetaHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class MetaHelper extends Base
public function renderMetaFields(array $values, array $errors = array(), array $attributes = array())
{
$metasettings = $this->metadataTypeModel->getAll();
$metadata = $this->taskMetadataModel->getAll($values['id']);
$html = '';

foreach ($metasettings as $setting) {
Expand All @@ -26,14 +25,16 @@ public function renderMetaFields(array $values, array $errors = array(), array $
$this->taskMetadataModel->save($values['id'], [$setting['human_name'] => '']);
}

$html .= $this->helper->form->label($setting['human_name'], 'metamagikkey_' . $setting['human_name']);
$html .= $this->helper->form->text('metamagikkey_' . $setting['human_name'], $values, $errors, $attributes, 'form-input-small');

if (!isset($values['id'])) {
$html .= $this->helper->form->label($setting['human_name'], 'metamagikkey_' . $setting['human_name']);
$html .= $this->helper->form->text('metamagikkey_' . $setting['human_name'], $values, $errors, $attributes, 'form-input-small');
}
}

}


$metadata = $this->taskMetadataModel->getAll($values['id']);


foreach ($metadata as $key => $value) {
$values['metamagikkey_' . $key] = $metadata[$key];
Expand Down

0 comments on commit 748b898

Please sign in to comment.