Jump to content

Module: Twitter Puller


apeisa
 Share

Recommended Posts

  • 1 year later...

Hi guys!

My first post and I have a problem with Data Import Module. I found processwire yesterday and it looks very promising for what I am looking to to do.

I keep on running into an error.

  

TemplateFile: Duplicate entry 'mariestads-julebrygd-1008' for key 'name_parent_id' INSERT INTO pages SET parent_id=1008, templates_id=43, name='mariestads-julebrygd', modified_users_id=41, status=1, sort=192,modified=NOW(), created=NOW(), created_users_id=41

When I run data import again it will add around 30 new products then the same error occurs. The xml that i need to read in is fairly large 15.000 products, by running the import a few times i manage to add around 150 products and all the data looks valid and in the right place. The file is in Swedish with ÅÄÖ chars in some values.

Here is a screen shot with the error message https://docs.google.com/file/d/0B5OdnzPkcg-gYzU0YjdrR3NFUzg/edit?usp=sharing

Here is the XML file: http://www.systembolaget.se/Assortment.aspx?Format=Xml

Thank you /mattias

Link to comment
Share on other sites

Hi Mattias and Welcome to PW. I haven't touched in Data Import module in two years and if I recall correctly I got it working "OK" with JSON but had lot's of issues with XML. As it states on module page (http://modules.processwire.com/modules/process-data-import/) it is a non working module.

I am not currently looking to finish that module, so your best bet would be building custom importer (those are fun to do and we are here to help you).

Link to comment
Share on other sites

That error just indicates that there is a name collision when creating a new page. In this case, there is already a page called mariestads-julebrygd and it's trying to insert a new page with the same name (in the same parent). All that would need to be done here is just to make sure that the imported records are unique in whatever is being  set to the $page->name field. If there is an ID column of some sort in the XML source data, that would be a good one to use for a $page->name field. 

Link to comment
Share on other sites

If xml is simple enough it should work. If there are attributes etc it will fail.

Maybe I should finish this. Thinking of making one version for json and another for xml. Or better yet, making these and csv importer working in harmony (sharing some bits of code like mapping etc).

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...