Closed (fixed)
Project:
Signup
Version:
5.x-2.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
9 Aug 2007 at 05:07 UTC
Updated:
28 Aug 2007 at 07:19 UTC
Jump to comment: Most recent file
If the event module is not installed, signup auto-closes on my nodes every time cron runs. I don't have a patch for this (I just commented out some code) but could create one if it would be helpful.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | signup_cron_query_builder_165791.patch.txt | 15.53 KB | dww |
Comments
Comment #1
dwwEvil, yeah. This was introduced by http://drupal.org/node/154580. Oversight on my part that I let this slip past me. :( This is IMHO critical -- we've broken signup.module for sites without event.module, which is a big no-no...
I have a few ideas. Probably the best thing is to replace the series of individual query builder functions for each date-driven feature (reminders and autoclose) with a single function for each one that expects an array. If the function doesn't exist or the array is empty, the feature is disabled. So, for example, in signup_event_5.x-1.inc, instead of this:
We'd have this:
Then, in signup_cron(), we'd see if signup_reminder_sql() was defined and returned data. If so, we'd handle the reminder emails, else, we'd skip all of that. Same story with the auto-close SQL and functionality...
Comment #2
dwwThis should do it. ;) This patch does the following:
A) Instead of N separate methods for each query fragment for each feature, there are now just 3 SQL query fragment functions that go in the *.inc files:
Each one returns an array of query elements it cares about.
B) Added a _signup_build_query() helper function to merge the results of these backend query element functions with the main, common SQL elements for each feature.
C) Split up signup_cron() into helper functions for each feature.
D) Moved the code to figure out what event-based backend .inc file we need into a method that could be shared by signup_menu() and signup_cron(). Previously, signup_cron() wasn't getting the .inc files at all, since hook_menu() isn't invoked during cron...
E) Added a bunch of phpdoc.
I tested this fairly heavily with event 5.x-1.* enabled and without, for both basic event and story (non-event) nodes, and all the autoclose stuff seems to be working correctly, as is the admin page. I didn't test reminder emails yet (but it's now 5am here and I *really* need sleep).
Reviews and testing would be most appreciated!
Thanks,
-Derek
Comment #3
samuelet commentedWorks for me with drupal 5.2.
It solves also bug which prevents the cron to run manually from shell.
Comment #4
mfbIt's working on my setup. cannot test reminders as I don't have the event module.
Comment #5
dwwCommitted to HEAD.
Comment #6
(not verified) commented