PHP E_ALL warnings (with code fix)

brmassa - October 7, 2008 - 19:27
Project:Drupal
Version:6.x-dev
Component:other
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

Gabor,

using D6.x (which prints all PHP E_ALL notices), some unwanted warnings are displayed:

* Fieldset without '#attributes' predefined. Its fixed by replacing the line 1515 on includes/form.inc

<?php
 
return '<fieldset'. (!empty($element['#attributes']) ? drupal_attributes($element['#attributes']) : '') .'>'. ($element['#title'] ? '<legend>'. $element['#title'] .'</legend>' : '') . (isset($element['#description']) && $element['#description'] ? '<div class="description">'. $element['#description'] .'</div>' : '') . (!empty($element['#children']) ? $element['#children'] : '') . (isset($element['#value']) ? $element['#value'] : '') ."</fieldset>\n";
?>

* Taxonomy terms, when created/edited, call taxonomy_term_path() and was supposed to give an OBJECT $term, but sometimes its just the term ID.
Its fixed by replacing the line 100 on modules/taxonomy.module (well... it fixes the taxonomy_term_path() function instead fixing the calling)

<?php
 
if (is_object($term)) {
   
$vocabulary = taxonomy_vocabulary_load($term->vid);
    if (
$vocabulary->module != 'taxonomy' && $path = module_invoke($vocabulary->module, 'term_path', $term)) {
      return
$path;
    }
    return
'taxonomy/term/'. $term->tid;
  }
  return
'taxonomy/term/'. $term;
?>

Sorry for not providing the patch file.

regards,

massa

#1

brmassa - October 7, 2008 - 19:27
Status:active» needs review

#2

earnie - October 7, 2008 - 20:21
Status:needs review» active

There is no patch.

#3

brmassa - October 9, 2008 - 22:54
Title:PHP E_ALL warnings» PHP E_ALL warnings (with code fix)

Gabor,

another place where E_ALL warning pop up. This patch will fix. See includes/xmlrpc.inc, line 70

<?php
   
if (!empty($xmlrpc_value->data->is_date)) {
      return
'date';
    }
    if (!empty(
$xmlrpc_value->data->is_base64)) {
?>

regards,

massa

 
 

Drupal is a registered trademark of Dries Buytaert.