[Rejected] Custom Profile Fields Hook
#1
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:
$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.
RedHat Certified Systems Administrator
Reply


Messages In This Thread
Custom Profile Fields Hook - by spork985 - 2015-06-21, 07:55 PM
RE: Custom Profile Fields Hook - by Destroy666 - 2015-06-22, 12:00 AM
RE: Custom Profile Fields Hook - by spork985 - 2015-06-22, 12:04 AM
RE: Custom Profile Fields Hook - by Destroy666 - 2015-06-22, 12:34 AM
RE: Custom Profile Fields Hook - by spork985 - 2015-06-22, 12:40 AM
RE: Custom Profile Fields Hook - by Jones H - 2015-06-27, 07:01 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)