modmore / importX

Addon for MODX Revolution which will take your CSV Formatted files (or raw paste) and transforms it into resources. Funded by Working Party (digital agency based in Sydney, @workingparty)
http://www.markhamstra.com/
23 stars 17 forks source link

publishedon and pub_date are ignored #29

Closed Rayden closed 8 years ago

Rayden commented 12 years ago

when i define publishedon and/or pub_date in the header and put a unix timestamp value in the csv data it doesnt put the values into the database.

createdon works fine

I tried importing in many ways putting published in the csv and with or without checking the published checkbox in default settings.

Mark-H commented 12 years ago

What version of MODX? Can you post a few rows of your csv (or email: hello markhamstra.com(? Op 4 dec. 2011 16:27 schreef "Raymond Geerts" < reply@reply.github.com> het volgende:

when i define publishedon and/or pub_date in the header and put a unix timestamp value in the csv data it doesnt put the values into the database.

createdon works fine

I tried importing in many ways putting published in the csv and with or without checking the published checkbox in default settings.


Reply to this email directly or view it on GitHub: https://github.com/Mark-H/importX/issues/29

Rayden commented 12 years ago

This occurs on MODx version 2.1.3-pl with importx version 1.0.0-pl

for example this is the CSV data (i deleted the tvs from it)

pagetitle;;;description;;;alias;;;template;;;createdon;;;publishedon;;;content Test;;;Dit is een test;;;test;;;1;;;1112902440;;;1112902440;;;

Some HTML code here

Mark-H commented 12 years ago

And you did set the divider to ";;;" in ImportX right?

Rayden commented 12 years ago

yes ofcourse ;) it imports all the data right, even the tvs go nice. its realy just the dates for publishedon and createdon that cant be set. Because when i look at the dates they show the date and time of when the import took place.

i found a temporary solution, but that means i have to manualy call some MySQL query.

Mark-H commented 12 years ago

Just looking at the MODX processors' code - it looks like it needs "published" to be passed to the processor for the publishedon date to be set.

"published" is set when the pub_date is set to < now. If no pub_date is set it depends on the actual "published" value.

Rayden commented 12 years ago

ok, its understandable the way that works.

the solution im using now is asfollow:

the query im using is:

SELECT link_attributes FROM modx_site_content FOR UPDATE; UPDATE modx_site_content SET createdon = link_attributes, publishedon = link_attributes, link_attributes = '' WHERE id >= '54';

the id 54 is just in my case, there are 53 resources that i created previously before the import ;)