Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue importing pub_date values #58

Open
Mark-H opened this issue Aug 2, 2014 · 1 comment
Open

Issue importing pub_date values #58

Mark-H opened this issue Aug 2, 2014 · 1 comment

Comments

@Mark-H
Copy link
Member

Mark-H commented Aug 2, 2014

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.

@Mark-H
Copy link
Member Author

Mark-H commented Aug 2, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant