summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2011-03-03 12:27:24 +0100
committerCarlo Landmeter <clandmeter@gmail.com>2011-03-03 12:27:24 +0100
commit3ff48d20528663593c5dfe675e4f3fd028fc9bfc (patch)
treea3b7f0fdf8ff5501a4f5aecc7e599c45b436a371
parent20a9cc3279fe6f7422bcc9ff9da3fe3d6b94ee77 (diff)
downloadapk_browser-3ff48d20528663593c5dfe675e4f3fd028fc9bfc.tar.bz2
apk_browser-3ff48d20528663593c5dfe675e4f3fd028fc9bfc.tar.xz
small repo editor bug
-rw-r--r--apk_browser.module8
1 files 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')