When create new dashboard, see error:

Notice: Undefined index: #value in spaces_dashboard_add_validate() (line 29 of /home/tiensi/Documents/Workspace/projects/spaces/trunk/spaces_dashboard/spaces_dashboard.admin.inc).

Comments

mrsinguyen’s picture

StatusFileSize
new825 bytes

Above patch not correctly, just upload new patch

mrsinguyen’s picture

Status: Active » Needs review

Changed status

mr.baileys’s picture

I'm able to reproduce this error with current HEAD.

The patch in #1 does not address the real issue though: since the form name is spaces_dashboard_add, Drupal's default behavior is to invoke spaces_dashboard_add_validate on the whole form (and not just for the individual elements where the same function was registered through #element_validate). Validation then fails since the top fieldset does not have the #value-property.

Either the spaces_dashboad_add_validate function needs to be rewritten so it loops through the custom dashboard label textfields, or it needs to be renamed so it is not invoked automatically by Drupal on the entire form.

Patch attached that implements the second alternative (renaming the element validation function).