Hi
Using EE 1.6.7
On our registration page we have added a module to display a few questions (a survey) for additional feedback, but we have just found that the information is not being stored (I am not the original developer). The data is validated correctly using the member_member_register_start hook, but the action to store the data in the member_member_register hook is never run. The extension is installed properly as far as I am aware, here is the activate_extension() method:
function activate_extension(){
global $DB;
$DB->query(
$DB->insert_string(
'exp_extensions',
array(
'extension_id' => '',
'class' => __CLASS__,
'method' => "validate_fields",
'hook' => "member_member_register_start",
'settings' => '',
'priority' => 10,
'version' => $this->version,
'enabled' => "y"
)
)
);
$DB->query(
$DB->insert_string(
'exp_extensions',
array(
'extension_id' => '',
'class' => __CLASS__,
'method' => "store_data",
'hook' => "member_member_register",
'settings' => '',
'priority' => 10,
'version' => $this->version,
'enabled' => "y"
)
)
);
}so validate_fields is fine, but store_data never seems to run (at all, I put a die statement at the start of the method, and it didn’t die), I presume member_member_register is meant to run after the registration is complete.
I think there is another extension that is using the member_member_register hook, if that would make any difference.
David
OK, it seems that another extension (ext1) we are using also uses that member_member_register hook, should there be a clash? I’ve changed the priority so that this extension (ext2) should run first, but it still doesn’t work (run). I tried disabling and enabling both extensions, when “ext1” is disabled, “ext2” does run correctly.
Once installed, the priority in the db will not change unless the extension changes it in the update method - you’ll need to increment the extension version, and include that change in said method, or uninstall and reinstall if you’re not worried about keeping settings and are just developing locally. You will also want to check to make sure that the extensions sharing the same hook are making use of the $last_call property.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.