- Patch #158440 by AjK: fixed E_NOTICEs.

6.x
Dries Buytaert 2007-07-11 15:27:57 +00:00
parent 6ec2ff7e15
commit 38a8d04f51
1 changed files with 5 additions and 4 deletions

View File

@ -1031,11 +1031,12 @@ function taxonomy_get_tree($vid, $parent = 0, $depth = -1, $max_depth = NULL) {
*/ */
function taxonomy_get_synonyms($tid) { function taxonomy_get_synonyms($tid) {
if ($tid) { if ($tid) {
$synonyms = array();
$result = db_query('SELECT name FROM {term_synonym} WHERE tid = %d', $tid); $result = db_query('SELECT name FROM {term_synonym} WHERE tid = %d', $tid);
while ($synonym = db_fetch_array($result)) { while ($synonym = db_fetch_array($result)) {
$synonyms[] = $synonym['name']; $synonyms[] = $synonym['name'];
} }
return $synonyms ? $synonyms : array(); return $synonyms;
} }
else { else {
return array(); return array();
@ -1443,7 +1444,7 @@ function taxonomy_term_page($str_tids = '', $depth = 0, $op = 'page') {
* Page to edit a vocabulary. * Page to edit a vocabulary.
*/ */
function taxonomy_admin_vocabulary_edit($vocabulary) { function taxonomy_admin_vocabulary_edit($vocabulary) {
if ($_POST['op'] == t('Delete') || $_POST['confirm']) { if ((isset($_POST['op']) && $_POST['op'] == t('Delete')) || isset($_POST['confirm'])) {
return drupal_get_form('taxonomy_vocabulary_confirm_delete', $vocabulary->vid); return drupal_get_form('taxonomy_vocabulary_confirm_delete', $vocabulary->vid);
} }
return drupal_get_form('taxonomy_form_vocabulary', (array)$vocabulary); return drupal_get_form('taxonomy_form_vocabulary', (array)$vocabulary);
@ -1453,7 +1454,7 @@ function taxonomy_admin_vocabulary_edit($vocabulary) {
* Page to edit a vocabulary term. * Page to edit a vocabulary term.
*/ */
function taxonomy_admin_term_edit($tid) { function taxonomy_admin_term_edit($tid) {
if ($_POST['op'] == t('Delete') || $_POST['confirm']) { if ((isset($_POST['op']) && $_POST['op']) == t('Delete') || isset($_POST['confirm'])) {
return drupal_get_form('taxonomy_term_confirm_delete', $tid); return drupal_get_form('taxonomy_term_confirm_delete', $tid);
} }
if ($term = (array)taxonomy_get_term($tid)) { if ($term = (array)taxonomy_get_term($tid)) {