fix(07-01): use loose comparison for form ID check in registration handler
- Changed !== to != to allow type coercion - Fixes registration not working due to string vs int comparison - Added type debugging to help diagnose similar issues
This commit is contained in:
@@ -268,11 +268,11 @@ class DDHH_JM_Formidable {
|
|||||||
* @param int $form_id Form ID.
|
* @param int $form_id Form ID.
|
||||||
*/
|
*/
|
||||||
public static function handle_registration_submission( $entry_id, $form_id ) {
|
public static function handle_registration_submission( $entry_id, $form_id ) {
|
||||||
error_log('DDHH Registration: Hook fired for form ' . $form_id . ', entry ' . $entry_id);
|
error_log('DDHH Registration: Hook fired for form ' . $form_id . ' (' . gettype($form_id) . '), entry ' . $entry_id);
|
||||||
|
|
||||||
// Only process our registration form
|
// Only process our registration form (use loose comparison for type coercion)
|
||||||
if ( $form_id !== self::get_registration_form_id() ) {
|
if ( $form_id != self::get_registration_form_id() ) {
|
||||||
error_log('DDHH Registration: Wrong form ID. Expected ' . self::get_registration_form_id());
|
error_log('DDHH Registration: Wrong form ID. Expected ' . self::get_registration_form_id() . ' (' . gettype(self::get_registration_form_id()) . ')');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user