From 3ff48d20528663593c5dfe675e4f3fd028fc9bfc Mon Sep 17 00:00:00 2001 From: Carlo Landmeter Date: Thu, 3 Mar 2011 12:27:24 +0100 Subject: small repo editor bug --- apk_browser.module | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apk_browser.module b/apk_browser.module index 5e86f08..b5491d6 100644 --- a/apk_browser.module +++ b/apk_browser.module @@ -100,7 +100,7 @@ function apk_browser_repository_delete_form_submit($form, &$form_state) { function apk_browser_repository_edit_form($form, &$form_state, $rid = array()) { $repos = variable_get('apk_repositories', array()); - if (!empty($rid)) { + if (is_string($rid)) { $form['repo_id'] = array('#type' => 'hidden', '#value' => $rid); if (!array_key_exists($rid, $repos)) { drupal_set_message(t('Please select an existing repository ID'), 'error'); @@ -126,7 +126,7 @@ function apk_browser_repository_edit_form($form, &$form_state, $rid = array()) { '#type' => 'textfield', '#title' => t('Repository URL'), '#size' => '100', - '#default_value' => (isset($rid['url'])) ? $repos[$rid]['url'] : '', + '#default_value' => is_string($rid) ? $repos[$rid]['url'] : '', '#description' => t('Link to the APKINDEX.tar.gz file inside the repository'), '#required' => TRUE, ); @@ -138,7 +138,7 @@ function apk_browser_repository_edit_form($form, &$form_state, $rid = array()) { '#type' => 'select', '#options' => $repo_options, '#title' => 'Select repository', - '#default_value' => (isset($rid['repo'])) ? $repos[$rid]['repo'] : '', + '#default_value' => is_string($rid) ? $repos[$rid]['repo'] : '', '#description' => t('Please make sure you select the correct repository. Preventing to do so will break package listing') ); @@ -148,7 +148,7 @@ function apk_browser_repository_edit_form($form, &$form_state, $rid = array()) { $form['settings']['arch'] = array( '#type' => 'select', '#options' => $arch_options, - '#default_value' => (isset($rid['arch'])) ? $repos[$rid]['arch'] : '', + '#default_value' => is_string($rid) ? $repos[$rid]['arch'] : '', '#title' => 'Select architecture', '#description' => t('Please make sure you select the correct architecture. Preventing to dox so will break package listing') -- cgit v1.2.3