Hello Decisions,

I have installed and themed the decision module and everything is working great. We've already had over 200 votes in just a few hours of use :-D

We are planning to run a Daily Poll with the decisions module, so we will be creating a lot of decisions. We made a list of about 20 different poll questions to start us off and began creating and adding new decisions to our site, all which are scheduled for 24-hour time frame so that when one expires the next one takes over but......

.....we found out that when we create a decision whose opening date is in the future, it overrides the current actively timed decision in the 'Decisions - Newest' block !!

Question: How can we prevent this behavior from happening? We'd like to create many decisions that are all dated in a sequence of 24 hour time frames, but we only want the current decision whose time has yet to expire to only appear in the 'Decisions - Newest' block.

I began reading through decisions.module but so far I haven't figured out an easy solution for this.

If someone could please help me out it would be GREATLY appreciated!!

Thank you in advance,
Mike

Comments

BigMike’s picture

One more question: If I create a new decision scheduled for, oh say next month, and I configure it as "Closed", will it automatically become Active the moment the scheduled time has arrived?

If so then that would solve my problems: I'll just create a ton of future decisions that are all Closed!

Again, thank you for your time
Mike

BigMike’s picture

Ok, I just confirmed that if a newly created future-scheduled decision is created as "Closed", then it does not override the current-scheduled decision in the 'Decisions - Newest' block.

But this doesn't answer what happens if an inactive decisions enters into its scheduled time frame, does it automatically enable itself?

BigMike’s picture

Ok, I just confirmed also that inactive future-scheduled decisions are not automatically activated once their scheduled time has come. The block simply states "No active decisions."

So this 'Decisions - Newest' block, in my opinion, has a serious shortcoming in this regard. What is the point of being able to schedule future-decisions when they override currently-scheduled decisions in the 'Decisions - Newest' block? You can't vote on the future decision, since it is scheduled for the future, AND you cannot vote on the current-scheduled decision because it is being replaced with the future-scheduled decision.

If someone could please provide a quick fix to the module file, I would greatly appreciate it. I am going to try to recode a part of the module this weekend and hopefully I can figure this out.

Thanks,
Mike

BigMike’s picture

Ok guys I have a preliminary solution to this.

In decisions.module, browse to line 1119:

$result = db_query_range(db_rewrite_sql('SELECT n.nid FROM {decisions} d INNER JOIN {node} n ON d.nid = n.nid WHERE d.active=1 AND n.status = 1 ORDER BY n.nid DESC'), 1);

If we change the sort order from descending to ascending, like this:

$result = db_query_range(db_rewrite_sql('SELECT n.nid FROM {decisions} d INNER JOIN {node} n ON d.nid = n.nid WHERE d.active=1 AND n.status = 1 ORDER BY n.nid ASC'), 1);

Then the block will pull the lowest numbered Decision node whose status is still active. This seems to work because I *think* when a Decision node expires, their status gets changed to inactive. If this is true, then this fix will work.

I'd LOVE to trouble shoot if this is true or not, but I cannot reconfigure dates how I see fit because of the Major Date Issue Bug with Decisions 6.x-1.7 (see http://drupal.org/node/1242172) that for the most part prevents date times from being altered (I already tried setting my own date just now [it's currently afternoon] and the time gets automatically switched back to AM instead of PM).

So for now, I've created a future-scheduled & active Decision that is NOT overriding the currently-active-scheduled Decision in the 'Decisions - Newest' block, thanks to the sort order change mentioned above, but I will have to wait until 1am tomorrow morning to see if the currently-active-Decision becomes automatically deactivated.

*fingers_crossed*
BigMike

BigMike’s picture

Ok guys,

I have confirmed that the resorting order fixes this issue, so long as you create your future-scheduled Decisions in the exact order as you'd like them to be used by this block (because we are sorting from the lowest node number to the highest node number).

This is a working solution for us.

Thanks
Mike

BigMike’s picture

Issue summary: View changes

grammar