Jump to:
| Project: | Profile role |
| Version: | 7.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
If you enable profile_role module and try to create new field on profile. You will get error after hit "Save field" button.
Fatal error: Call to undefined function profile_role_profile_field_form_submit() in /var/www/drupal/includes/form.inc on line 1054 Call Stack: 0.0000 651648 1. {main}() /var/www/drupal/index.php:0 0.0176 4709040 2. menu_execute_active_handler() /var/www/drupal/index.php:22 0.0176 4715368 3. call_user_func_array() /var/www/drupal/includes/menu.inc:469 0.0176 4715984 4. drupal_get_form() /var/www/drupal/includes/menu.inc:0 0.0176 4717448 5. drupal_build_form() /var/www/drupal/includes/form.inc:78 0.0189 4859120 6. drupal_process_form() /var/www/drupal/includes/form.inc:225 0.0257 6308776 7. form_execute_handlers() /var/www/drupal/includes/form.inc:640
It is happen due to unimplemented call to profile_role_profile_field_form_submit function.
function profile_role_form_profile_field_form_alter(&$form, $form_state) {
$form['#submit'][] = 'profile_role_profile_field_form_submit';
}If you explain for what purpose it was designed to hook submit function i can roll the patch to fix it.
Comments
#1
In D6, the module pointed to the following function:
<?phpfunction profile_role_prune_roles() {
// Must delete records in loop since DELETE WHERE IN (SELECT) does not work.
$result = db_query('SELECT r.category
FROM {profile_role} r
LEFT JOIN {profile_fields} f
ON f.category = r.category
WHERE f.category IS NULL');
while ($category = db_result($result)) {
db_query("DELETE FROM {profile_role} WHERE category = '%s'", $category);
}
}
?>
I'd imagine we could use the same function in D7. I'll try testing it out and roll a patch to here if possible.