From c46e05b18df803fcc5c624b6a6f1d8558c4a7c14 Mon Sep 17 00:00:00 2001 From: Carlo Landmeter Date: Thu, 3 Mar 2011 08:47:13 +0100 Subject: cannot edit repo ID 0 PHP see 0 as empty --- apk_browser.module | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'apk_browser.module') diff --git a/apk_browser.module b/apk_browser.module index e53ce53..f478e82 100644 --- a/apk_browser.module +++ b/apk_browser.module @@ -116,7 +116,7 @@ function apk_browser_repository_edit_form($form, &$form_state, $rid = array()) { '#type' => 'textfield', '#title' => t('Repository URL'), '#size' => '100', - '#default_value' => (empty($rid)) ? '' : $repos[$rid]['url'], + '#default_value' => (isset($rid)) ? $repos[$rid]['url'] : '', '#description' => t('Link to the APKINDEX.tar.gz file inside the repository'), '#required' => TRUE, ); @@ -128,7 +128,7 @@ function apk_browser_repository_edit_form($form, &$form_state, $rid = array()) { '#type' => 'select', '#options' => $repo_options, '#title' => 'Select repository', - '#default_value' => (empty($rid)) ? '' : $repos[$rid]['repo'], + '#default_value' => (isset($rid)) ? $repos[$rid]['repo'] : '', '#description' => t('Please make sure you select the correct repository. Preventing to do so will break package listing') ); @@ -138,7 +138,7 @@ function apk_browser_repository_edit_form($form, &$form_state, $rid = array()) { $form['settings']['arch'] = array( '#type' => 'select', '#options' => $arch_options, - '#default_value' => (empty($rid)) ? '' : $repos[$rid]['arch'], + '#default_value' => (isset($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