Browse Source

bug fixe on édit page for precedent patch

Signed-off-by: bachy <git@g-u-i.net>
bachy 12 years ago
parent
commit
2030a6f810
2 changed files with 2 additions and 2 deletions
  1. 1 1
      search_api_page.admin.inc
  2. 1 1
      search_api_page.module

+ 1 - 1
search_api_page.admin.inc

@@ -370,7 +370,7 @@ function search_api_page_admin_edit(array $form, array &$form_state, Entity $pag
   $form['result_page_search_form'] = array(
     '#type' => 'radios',
     '#title' => t('Search form on result page'),
-    '#default_value' => $page->options['per_page'],
+    '#default_value' => isset($page->options['result_page_search_form']) ? $page->options['result_page_search_form'] : 1,
     '#options' => array('1' => t('Enabled'), '0' => t('Disabled')),
     '#description' => t('Enable or disable the search form on the result page'),
   );

+ 1 - 1
search_api_page.module

@@ -364,7 +364,7 @@ function search_api_page_insert(array $values) {
  */
 function search_api_page_edit($id, array $fields) {
   $page = search_api_page_load($id, TRUE);
-  $changeable = array('name' => 1, 'description' => 1, 'path' => 1, 'options' => 1, 'enabled' => 1);
+  $changeable = array('name' => 1, 'description' => 1, 'path' => 1, 'options' => 1, 'enabled' => 1, 'result_page_search_form'=>1);
   foreach ($fields as $field => $value) {
     if (isset($changeable[$field]) || $value === $page->$field) {
       $page->$field = $value;