Closed (fixed)
Project:
Notifications
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
26 Jul 2009 at 06:20 UTC
Updated:
21 May 2010 at 12:20 UTC
I'm writing a custom module that creates a form to provide a simplified interface for users to update their subscriptions, but the form_submit function times out when it invokes the notifications_save_subscription function. It gets hung up when notifications_save_subscription calls the notifications_module_invoke function just before exiting. (If I comment out the notifications_module_invoke call, the timeout error goes away.)
Here's the code of my submit function:
<?php
function job_notifications_form_submit($form_id, $form_values) {
$uid = $form_values['account']->uid;
// notifications_delete_subscriptions(array('uid' => $uid));
$default_options = array(
'uid' => $uid,
'type' => 'taxonomy',
'event_type' => 'node',
'conditions' => '1',
'send_interval' => '0',
'send_method' => 'mail',
'cron' => '1',
'module' => 'notifications',
'status' => '1',
);
foreach ($form_values['subscriptions'] as $vid => $checkboxes) {
foreach ($checkboxes as $tid => $value) {
if ($value) {
$subscription = $default_options;
$subscription['fields'] = array();
$subscription['fields']['tid'] = $tid;
notifications_save_subscription($subscription);
}
}
}
}
?>
Comments
Comment #1
jose reyero commentedSome custom hook_notifications() causing the loop?
It will be called with ($op, $subscription)
Comment #2
jose reyero commented