importX
importX copied to clipboard
Issue importing pub_date values
I decided to upload a bunch of resources with defined pub_date. Pub_dates were in unix format and were set as “future dates”. I mean I expected the resources to be published later on this month. But when I finished importing, all of the resources were published))))
Reported by Ivan B
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
resource/create processor:
$now = time();
if (isset($scriptProperties['pub_date'])) {
if (empty($scriptProperties['pub_date'])) {
$scriptProperties['pub_date'] = 0;
} else {
$scriptProperties['pub_date'] = strtotime($scriptProperties['pub_date']);
if ($scriptProperties['pub_date'] < $now) $scriptProperties['published'] = 1;
if ($scriptProperties['pub_date'] > $now) $scriptProperties['published'] = 0;
}
}
The core expects it to be a time string as indicated by the strtotime function call