bug fixe on édit page for precedent patch

Signed-off-by: bachy <git@g-u-i.net>
This commit is contained in:
bachy 2012-07-22 17:02:31 +02:00
parent 256475e716
commit 2030a6f810
2 changed files with 2 additions and 2 deletions

View File

@ -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'),
);

View File

@ -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;