Login!
Lost password?
 

MODx Bug/Feature Tracker and Feature Requests

Welcome to the MODx CMS Tracker. Please choose the appropriate project from the drop down menu and provide as much information as possible regarding your server environment and browser. Thanks!

FS#915 — Documents cannot be published with a publish date "exactly".

Attached to Project — MODx
Opened by Shobu UMEMURA (shobu) - Thursday, 12 July 2007, 07:14AM
Last edited by Brunaud (coroico) - Friday, 09 May 2008, 03:07AM
Task Type Bug Report
Category Core Distribution
Status Closed
Assigned To Garry Nutting (garryn)
Operating System All
Severity Medium
Priority Normal
Reported Version 0.9.6
Due in Version 0.9.6.2
Due Date Undecided
Percent Complete 100%

Details

1. Set a (un)publish date to the document.
(ex. 30/07/07 10:00:00)
2. Browse the site( and MODx are checking schedule.) on (un)publish date of the document exactly. (access just 30/07/07 10:00:00)
3. The document isn't published.

Solution:
/manager/includes/document.parser.class.inc.php
FUNCTION: checkPublishStatus()

this lines.
----------------------
$sql = "UPDATE ".$this->getFullTableName("site_content")." SET published=1, publishedon=".time()." WHERE ".$this->getFullTableName("site_content").".pub_date < $timeNow AND ".$this->getFullTableName("site_content").".pub_date!=0 AND published=0";
----------------------
$sql= "UPDATE " . $this->getFullTableName("site_content") . " SET published=0, publishedon=0 WHERE " . $this->getFullTableName("site_content") . ".unpub_date < $timeNow AND " . $this->getFullTableName("site_content") . ".unpub_date!=0 AND published=1";
----------------------

change to
----------------------
$sql = "UPDATE ".$this->getFullTableName("site_content")." SET published=1, publishedon=".time()." WHERE ".$this->getFullTableName("site_content").".pub_date <= $timeNow AND ".$this->getFullTableName("site_content").".pub_date!=0 AND published=0";
----------------------
$sql= "UPDATE " . $this->getFullTableName("site_content") . " SET published=0, publishedon=0 WHERE " . $this->getFullTableName("site_content") . ".unpub_date <= $timeNow AND " . $this->getFullTableName("site_content") . ".unpub_date!=0 AND published=1";
----------------------

cause:
checkPublishStatus() has below line.
if ($cacheRefreshTime <= $timeNow && $cacheRefreshTime != 0) {

If $cacheRefreshTime, $timeNow and pub_date(In SQL) are same value, above conditional line return TRUE and execute above SQL.
But, SQL with (pub_date < $timeNow) return FALSE and do nothing...
After this process, $cacheRefreshTime is incremented the next schedule...

This task depends upon

This task blocks these from closing
Closed by  Brunaud (coroico)
Friday, 09 May 2008, 04:50AM
Reason for closing:  Fixed
Comment by Garry Nutting (garryn) - Wednesday, 21 November 2007, 06:33PM
  • Field changed: Status (Unconfirmed → Requires testing)
  • Field changed: Due in Version (Undecided → 0.9.6.2)
  • Field changed: Percent Complete (0% → 100%)
  • Field changed: Due Date (Undecided → Undecided)
  • Task assigned to Garry Nutting (garryn)
Fixed in SVN rev 3167.

Comment by Brunaud (coroico) - Thursday, 08 May 2008, 05:00PM
Test executed : creation of a document with a publish date & hour at 23:54:00. Before the exact hour the document is unpublished. And then published at the exact hour.