Agaric Design Collective

form_alter

"Content profile registration broken": debugging rogue form validate overrides

Bad coding in a development partner's custom module was the culprit. It was overriding content_profile_registration's setting of a validation function (and every other module's, too).

Inside the custom module's implementation of hook_form_alter() lives the error:
<?php
switch ($form_id) {
// ... ignore lots of code
case 'user_register':
// ... ignore more code

 

A fatal error without any of your code in the backtrace: check your form_alter

Fatal error: Cannot use string offset as an array in /home/ben/code/pdonline/drupal/includes/form.inc on line 976
Call Stack
# Time Memory Function Location
1 0.0019 64260 {main}( ) ../index.php:0
2 2.7990 23389320 menu_execute_active_handler( ) ../index.php:18
3 2.8490 23579028 call_user_func_array ( ) ../menu.inc:348
4 2.8490 23579192 node_add( ) ../menu.inc:0

 

Not seeing CCK fieldsets when you form_alter your form?

In #drupal channel on IRC, mikey_p reminds that the CCK fieldgroup module has a weight of 9, so your module implementing hook_form_alter has to have a heavier weight (higher number) if you want to see that.