OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Registration Closes Too Soon

Are you responsible for making OCS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, michael, John

Forum rules
What to do if you have a technical problem with OCS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved. Please note that this FAQ is OJS-centric, but most issues are applicable to both platforms.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OCS Conference Support and Discussion subforum; if you have a development question, try the OCS Development subforum.

Registration Closes Too Soon

Postby tshore » Thu Apr 15, 2010 12:55 pm

The expected behaviour for a registration type is that it should be available until midnight on the closing date. However, it seems to be unavailable for the entire closing date (ie. from 00:00 on). Now, I have done some customization to the registration process, so there is a possibility that I mucked this up, but I don't think so. I think the problem is that, although the closing date is stored in the DB with the time (ie. 2010-04-15 23:59:59), when it's retrieved by:

$registrationType->getClosingDate() in templates/registration/selectRegistrationType.tpl

only the date part gets returned (ie. 2010-04-15). I think the same problem would happen with registration options as well. I've been battling this problem all the way back to OCS 1.x. Where we don't have the problem anymore is with the abstract submission closing date. This date is retrieved with a different mechanism than the closing dates for registration types/options.

The function getClosingDate appears in:

classes/registration/RegistrationType.inc.php
classes/registration/RegistrationOption.inc.php

And these both call getData('closingDate').

I hacked together a pretty sad fix in templates/registration/selectRegistrationType.tpl
Code: Select all
      {assign var="closeDateNoTime" value=$registrationType->getClosingDate()}
      {assign var="notQuiteMidnight" value=' 23:59:59'}
      {assign var="closeDateWithTime" value=$closeDateNoTime$notQuiteMidnight}

and then, in any comparison containing $registrationType->getClosingDate(), I replaced it with $closeDateWithTime. Of course, I should've fixed it in the class file, but I couldn't figure out how to do that.

I didn't fix it for the registration options. I'll just make sure that the dates are set so that we don't run into problems with this.
tshore
 
Posts: 264
Joined: Fri Nov 18, 2005 12:48 pm
Location: Hamilton, Ontario

Re: Registration Closes Too Soon

Postby jmacgreg » Mon Apr 19, 2010 10:55 am

Hi Trudy,

I've replicated in a clean copy of OCS, and have filed this as a bug. Please see http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=5324, and feel free to CC yourself for future updates.

Cheers,
James
jmacgreg
 
Posts: 4186
Joined: Tue Feb 14, 2006 10:50 am

Re: Registration Closes Too Soon

Postby tshore » Fri Oct 01, 2010 2:39 pm

Any chance of a patch for this? I was surprised to see that it wasn't fixed in 2.3.3.
tshore
 
Posts: 264
Joined: Fri Nov 18, 2005 12:48 pm
Location: Hamilton, Ontario

Re: Registration Closes Too Soon

Postby jmacgreg » Mon Oct 04, 2010 6:59 pm

Hi Trudy,

2.3.3 wasn't a broad release -- it was released to address a handful of specific issues (including, primarily, one security issue -- see this page for details). The good news is that with OJS 2.3.3 out the door, we'll be returning attention to OCS, and will be planning a more comprehensive release in the next few months which will hopefully include a fix for this issue.

Cheers,
James
jmacgreg
 
Posts: 4186
Joined: Tue Feb 14, 2006 10:50 am

Re: Registration Closes Too Soon

Postby tshore » Thu Sep 08, 2011 10:06 pm

I can't believe that this bug has bitten me yet again. What a huge waste of time...
tshore
 
Posts: 264
Joined: Fri Nov 18, 2005 12:48 pm
Location: Hamilton, Ontario

Re: Registration Closes Too Soon

Postby michael » Mon Sep 19, 2011 2:02 pm

Hi Trudy,

tshore wrote:The expected behaviour for a registration type is that it should be available until midnight on the closing date. However, it seems to be unavailable for the entire closing date (ie. from 00:00 on). Now, I have done some customization to the registration process, so there is a possibility that I mucked this up, but I don't think so. I think the problem is that, although the closing date is stored in the DB with the time (ie. 2010-04-15 23:59:59), when it's retrieved by:

$registrationType->getClosingDate() in templates/registration/selectRegistrationType.tpl

only the date part gets returned (ie. 2010-04-15). I think the same problem would happen with registration options as well. I've been battling this problem all the way back to OCS 1.x. Where we don't have the problem anymore is with the abstract submission closing date. This date is retrieved with a different mechanism than the closing dates for registration types/options.

The function getClosingDate appears in:

classes/registration/RegistrationType.inc.php
classes/registration/RegistrationOption.inc.php


Thanks for the detailed breakdown of the issue. A fix will be included as part of the upcoming OCS 2.3.4 release. Additional details and fix for existing installations is included in the bug report.

Cheers,
Michael
michael
 
Posts: 404
Joined: Thu Mar 29, 2007 2:09 pm

Re: Registration Closes Too Soon

Postby tshore » Mon Sep 19, 2011 2:12 pm

Thanks Michael.
tshore
 
Posts: 264
Joined: Fri Nov 18, 2005 12:48 pm
Location: Hamilton, Ontario

Re: Registration Closes Too Soon

Postby tshore » Thu Mar 15, 2012 8:03 am

I don't think it was fixed in 2.3.4!!!

My early registrations were supposed to close at midnight tonight. However, it seems as if they closed at midnight last night. This is the exact same bug that I've been struggling with for YEARS. You might notice that I've posted in this thread in 2010 and 2011.

Here's what needs to be fixed. Please, please, please patch it and include it in the next release.

In classess/registration/RegistrationTypeDAO.inc.php, in the function returnRegistrationTypeFromRow(), you need to change lines 254-256 from:
Code: Select all
$registrationType->setOpeningDate($this->dateFromDB($row['opening_date']));
$registrationType->setClosingDate($this->dateFromDB($row['closing_date']));
$registrationType->setExpiryDate($this->dateFromDB($row['expiry_date']));
to:
Code: Select all
$registrationType->setOpeningDate($this->datetimeFromDB($row['opening_date']));
$registrationType->setClosingDate($this->datetimeFromDB($row['closing_date']));
$registrationType->setExpiryDate($this->datetimeFromDB($row['expiry_date']));


Thank you.
tshore
 
Posts: 264
Joined: Fri Nov 18, 2005 12:48 pm
Location: Hamilton, Ontario

Re: Registration Closes Too Soon

Postby asmecher » Thu Mar 15, 2012 9:48 am

Hi tshore,

A similar change was committed about 6 months ago (see https://github.com/pkp/ocs/commit/645122f2071ab099baf074e23bd3c1422830220b). This will be released very shortly with OCS 2.3.5. Note that the call to dateFromDB should not be changed for setOpeningDate.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8426
Joined: Wed Aug 10, 2005 12:56 pm

Re: Registration Closes Too Soon

Postby tshore » Fri Mar 16, 2012 6:11 am

Oh, I see what you mean re:
Note that the call to dateFromDB should not be changed for setOpeningDate.

I thought that the opening dates were in the form YYYY-MM-DD 00:00:00, but I see that all of the dates end in 23:59:59.
tshore
 
Posts: 264
Joined: Fri Nov 18, 2005 12:48 pm
Location: Hamilton, Ontario


Return to OCS Technical Support

Who is online

Users browsing this forum: No registered users and 2 guests