[drupal-devel] E_ALL: which way to correct each error notice?

Anguo linux-tw at masquilier.org
Fri Oct 14 14:16:56 UTC 2005

On Friday 14 October 2005 10:36 am, Steve Dondley wrote:

I need your feedback on which of two solutions I should use 
to make Drupal E_STRICT compliant.

> else if (isset($result)) {
> to this:
> else if (isset($result)  && $result != '') {

This discussion is relevant to this:
(drupal base and E_NOTICE)

An example of the error notice we get is when going to 

   notice: Undefined index:  #attributes in 
     includes/form.inc on line 54.
   notice: Undefined index:  class in 
     includes/form.inc on line 54.

the line is part of:
   function drupal_get_form ($form_id, 
      &$form, $callback = NULL)
which is called in this case from system.module from
   function system_view_general()

Now I can solve this problem in by declaring the array this 
    $form['#attributes']['class'] = array ();
I can add this line 
1- either within the function drupal_get_form in 
2- or within the function system_view_general in 

Which way would be better/correct?

Another similar example:
   notice: Undefined index:  #built in 
      includes/form.inc on line 180.
should I change in the said line:
   if ($form['#built'] == TRUE) {
   if (isset($form['#built'] AND $form['#built'] == TRUE) {
or should I go back to where the function was called from, 
and declare the array there?

By the way, looking at admin/settings, there are over 1480 
such errors!!! most of them coming from form.inc.

I'm working on updating the already proposed patches, but I 
need to know which way to go.

thank you.

Because we and the world need to change.
Intimate Relationships, peace and harmony in the couple.

Revolutionary Psychology, White Tantrism, Dream Yoga...

Condorcet, Approval alternative, better voting methods.

More information about the drupal-devel mailing list