We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Invite timeout on events plugin{bug-to be fixed} | Forum

Sven Laschinski
Sven Laschinski Sep 15 '15
Hey there Oxwall Team... and everyone else of course. :)


On Motospace we're using a modified version of your events plugin. So we discovered a problem with invitations that time out (i.e. get deleted) pretty fast. I decided to look up the problem and compared the code to the events plugin. But guess what? It's still exactly the same. :) So here we go:


The cron job has to run every minute. That's what the documentation says. As far as I understood, in that process the cron.php of every plugin gets started as well. So I looked at that and found

$this->addJob('clearInvitations', 20);


The 20 is the interval... I'm not sure what that exactly means, but every 20 runs this one get's executed, too? Something like that? Well anyway... as it get's called it starts

EVENT_BOL_EventService::getInstance()->findCronExpiredEvents(0, 1500);

which later is used to fire up the "clearEventInvitations" function based on the list it got back. So I check what that does... it calls another function but to make a long story short, it boils down to an SQL query which is the following:

$query = " SELECT DISTINCT `e`.* FROM `" . $this->getTableName() . "` as `e` "

. " INNER JOIN `" . EVENT_BOL_EventInviteDao::getInstance()->getTableName() . "` as `ei` ON ( `ei`.eventId = e.id ) "

. " WHERE 1 ORDER BY `e`.`startTimeStamp` DESC LIMIT :first, :count";


So... "WHERE 1". Wait, what? EVERY invitation is in that list? So every single time "clearInvitations" is actually executed, it deletes ALL invitations? That can't be right, can it? And that would explain why some or even all invitations get deleted before anyone would have a chance to accept it.


So what's wrong here? Did I misunderstand the code? If so, why and when are invitations deleted? Wouldn't it be nice if they got deleted... well, after the event already started or something? Seems not to be the case, actually.


But maybe it's some misconfiguration on our side. Maybe the modified plugin does not behave as expected, but as far as I can see, it does exactly the same thing as the original event plugin. After all it's not modified that heavily. Actually it's almost not modified at all.


So can you explain or maybe even fix that in the event plugin please? Some options would be nice on this one,too. To change when those invitations actually get deleted.

The Forum post is edited by ross Sep 18 '15
ross Team
ross Sep 16 '15
It deletes the invitation of expired events, the ones that already ended. 
Sven Laschinski
Sven Laschinski Sep 17 '15
Yeah except it doesn't.

As you can read in the SQL-Query: "WHERE 1". Or in other words: E-v-e-r-y-t-h-i-n-g

ross Team
ross Sep 18 '15
Sven turned out you were right, it deletes all invitations even for the events which are not expired. We have reported to our devs, it will be fixed asap. 
robi782
robi782 Sep 21 '15
Ross please publish here the adaptation of the developers when it will be available. OK? :)
ross Team
ross Sep 21 '15
I'm sorry but this will be available in the next update only. 
robi782
robi782 Sep 21 '15
Sorry. But I think the Changelog can be post her. Why not? :/
ross Team
ross Sep 21 '15

Quote from ross Sven turned out you were right, it deletes all invitations even for the events which are not expired. We have reported to our devs, it will be fixed asap. 

robi782
robi782 Mar 2 '16
Ross, fixed? :)
ross Team
ross Mar 2 '16
yes, the issue is fixed in 1.8.1 
robi782
robi782 Mar 2 '16
thanks for your information. :)