2015-06-21, 07:55 PM
In admin/modules/config/profile_fields.php, I believe the admin_config_profile_fields_add_commit hook should be moved above the insert query for the add function. If you look at the edit function, the hook comes right before the update, allowing you to modify the array before being inserted.
Current:
Suggested:
Unless this was intentional? As is it does return the fid, so I guess you could write a separate query off of that? I just find it odd that both functions (add and edit) don't agree on order.
Current:
$fid = $db->insert_query("profilefields", $new_profile_field);
$db->write_query("ALTER TABLE ".TABLE_PREFIX."userfields ADD fid{$fid} TEXT");
$plugins->run_hooks("admin_config_profile_fields_add_commit");
Suggested:
$plugins->run_hooks("admin_config_profile_fields_add_commit");
$fid = $db->insert_query("profilefields", $new_profile_field);
$db->write_query("ALTER TABLE ".TABLE_PREFIX."userfields ADD fid{$fid} TEXT");
Unless this was intentional? As is it does return the fid, so I guess you could write a separate query off of that? I just find it odd that both functions (add and edit) don't agree on order.