2007-08-29, 07:19 AM
I'm not sure if this is in the right place, so feel free to move it if not.
In admin/forums.php, lines 234-235 (in the add forums section) are as follows:
As you can see, the run_hooks function is run AFTER the data is added to the database. This is in contrast to every other update/add query in the file, which always does run_hooks BEFORE the update. I am in the process of creating a mod for a friend of mine, and have the need to modify some of the data that will be traveling to the database for new forums. Having the run_hooks after the query means that I have to get the insertid and run a new, separate query just to update one piece of data.
I hope the developers would consider moving the run_hooks up one line, above the query, in future versions of MyBB, as it is a simple thing and is inconsistent with the rest of the file.
Thank you.
In admin/forums.php, lines 234-235 (in the add forums section) are as follows:
$db->insert_query(TABLE_PREFIX."forums", $sqlarray);
$plugins->run_hooks("admin_forums_do_add");
As you can see, the run_hooks function is run AFTER the data is added to the database. This is in contrast to every other update/add query in the file, which always does run_hooks BEFORE the update. I am in the process of creating a mod for a friend of mine, and have the need to modify some of the data that will be traveling to the database for new forums. Having the run_hooks after the query means that I have to get the insertid and run a new, separate query just to update one piece of data.
I hope the developers would consider moving the run_hooks up one line, above the query, in future versions of MyBB, as it is a simple thing and is inconsistent with the rest of the file.
Thank you.