Re: Re: [Jason] Can removeDate be optional?

4 posts by 2 authors in: Forums > CMS Builder
Last Post: September 13, 2019   (RSS)

Hey Tim,

I agree that having a blank remove date be "ignored" is the more intuitive (and potentially useful) behaviour, however, this sort of change needs to be carefully considered as it may not be backwards-compatible. I'll flag this topic for internal discussion.

Thanks!

Daniel
Technical Lead
interactivetools.com

Hi Tim,

We've elected to make this change and include it in the next version of CMSB. If you'd like to apply the functionality before then, it's fairly simple to patch.

In /cmsb/lib/viewer_functions.php, find the following line (Line 1309 in CMSB 3.53):

$thisCondition  = "{$tableNameDot}removeDate >= NOW()";  // NULL end date or future end date

And replace it with this:

$thisCondition  = "({$tableNameDot}removeDate >= NOW() || {$tableNameDot}removeDate = '0000-00-00 00:00:00')";  // NULL end date or future end date

Note that this patch hasn't gone through final review yet, so use at your own caution.

As well, since I didn't see it mentioned in the previous thread, I feel it's worth noting that there's another special field called "neverRemove" - this field can be added as a checkbox to a section to ignore the removeDate on a per-record basis. This could be useful in some cases where it's not possible to upgrade or patch.

Let me know any questions!

Thanks,

Daniel
Technical Lead
interactivetools.com

Excellent!  thanks for that  

Cheers,

Tim (toledoh.com.au)