Skip to content

Commit

Permalink
Fix bug in creating seo-backend
Browse files Browse the repository at this point in the history
  • Loading branch information
hadimansouri committed Nov 14, 2018
1 parent d3141bb commit b989f6d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/Seo/Engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function getGeneralParam ()
'name' => 'title',
'type' => 'String',
'unit' => 'none',
'title' => 'title',
'title' => 'Title',
'description' => 'beackend title',
'editable' => true,
'visible' => true,
Expand All @@ -140,7 +140,7 @@ public function getGeneralParam ()
'name' => 'description',
'type' => 'String',
'unit' => 'none',
'title' => 'description',
'title' => 'Description',
'description' => 'beackend description',
'editable' => true,
'visible' => true,
Expand Down Expand Up @@ -213,4 +213,4 @@ public function render ($request)
// XXX: maso, 1395: ایجاد یک پرداخت
}

}
}
13 changes: 6 additions & 7 deletions src/Seo/Form/BackendNew.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,12 @@ class Seo_Form_BackendNew extends Pluf_Form
public function initFields($extra = array())
{
$this->engine = $extra['engine'];

$params = $this->engine->getParameters();
$options = array(
// 'required' => $param['required']
'required' => false
);
foreach ($params['children'] as $param) {
foreach ($params as $param) {
$options = array(
// 'required' => $param['required']
'required' => in_array('NotNull', $param['validators'])
);
$field = null;
switch ($param['type']) {
case 'Integer':
Expand Down Expand Up @@ -82,7 +81,7 @@ function save($commit = true)
$backend->setFromFormData($this->cleaned_data);
$backend->engine = $this->engine->getType();
$params = $this->engine->getParameters();
foreach ($params['children'] as $param) {
foreach ($params as $param) {
if (array_key_exists($param['name'], $backend->_a['cols']))
continue;
$backend->setMeta($param['name'], $this->cleaned_data[$param['name']]);
Expand Down

0 comments on commit b989f6d

Please sign in to comment.