commas in taxonomies

Closed

Import WP Pro Updated 1 year ago 17 Replies

Andreas asked 1 year ago on December 8, 2022 at 10:43 am

Hello,
in my csv I have a field which contains commas. (f.e.  \”firstname, lastname\”)
This field is used as a taxonomy – but because of the comma it creates 2 taxonomy items.
So it should only create one taxonomy named \”firstname, lastname\”. Is this possible.

Is there an option to change it programmatically at the import? I have seen the code snippet, but I\’m not sure if this also will work with taxonomies.

thank you

J

James replied Support Agent

1 year ago on December 8, 2022 at 10:51 am

You can change the delimiter for taxonomies

<?php

add_filter('iwp/taxonomy/value_delimiter', function($delimiter){
    return '|';
});
AS

Andreas replied

1 year ago on December 8, 2022 at 3:47 pm

Looks like this worked.
Thank you

Just one more question: All my imported data is set as draft. Is it possible to set it automatically to published?

J

James replied Support Agent

1 year ago on December 8, 2022 at 3:53 pm

Enable the post status field and set it to publish. by deafult it uses your sites default setting which is "draft"

AS

Andreas replied

1 year ago on December 8, 2022 at 4:03 pm

I've enabled it now and run the import again - but the data is still set as draft

J

James replied Support Agent

1 year ago on December 8, 2022 at 4:13 pm

What does the history tab show? does it have "updated" or "inserted" on it? and is the post_status field listed?

AS

Andreas replied

1 year ago on December 8, 2022 at 4:16 pm

Does the CSV need a post_status column? (would it be possibile without one - so create it via import?)



History: (can't see a post_status field there)

Status: complete, Records: 1764 / 1764, Updates: 1760, Time: 42s

 

J

James replied Support Agent

1 year ago on December 8, 2022 at 4:19 pm

There should be a list of records below showing what was imported, shown in the last image of the page?

https://www.importwp.com/docs/importer/getting-started/import-history/

AS

Andreas replied

1 year ago on December 8, 2022 at 4:22 pm

yes, but I can't see a post_status field here.

 

2Record Updated: #12858 (post_title, post_content), car-year: (2012 - &gt;), car-model: (595C, Cabrio), car-brand: (Abarth), Custom Fields (fits-albert, albert-seat-1, albert-seat-1-comment, albert-seat-2, albert-seat-2-comment, albert-seat-3, albert-seat-3-comment, albert-seat-4, albert-seat-4-comment, albert-seat-5, albert-seat-5-comment, albert-seat-6, albert-seat-6-comment, albert-seat-7, albert-seat-7-comment, marie-seat-1, marie-seat-1-comment, marie-seat-2, marie-seat-2-comment, marie-seat-3, marie-seat-3-comment, marie-seat-4, marie-seat-4-comment, marie-seat-5, marie-seat-5-comment, marie-seat-6, marie-seat-6-comment, marie-seat-7, marie-seat-7-comment, fits-marie, fits-charlie, charlie-seat-1, charlie-seat-1-comment, charlie-seat-2, charlie-seat-2-comment, charlie-seat-3, charlie-seat-3-comment, charlie-seat-4, charlie-seat-4-comment, charlie-seat-5, charlie-seat-5-comment, charlie-seat-6, charlie-seat-6-comment, charlie-seat-7, charlie-seat-7-comment)
J

James replied Support Agent

1 year ago on December 8, 2022 at 4:26 pm

Just to confirm that you had saved the importer after you enabled and set the field to publish?

 

AS

Andreas replied

1 year ago on December 8, 2022 at 4:44 pm

I have just tried it again - enabled the publish status - saved it, but it looks like it does not get saved. When i open it again I have to enable it again.

Same with some of my custom fields. There's written "Select ..." but if I click on "Enable Text Field" then the correct value is written.

J

James replied Support Agent

1 year ago on December 8, 2022 at 4:53 pm

If data is not saving, then it suggests an error is occuring, does your error log have any new rows added when you save?

Are you able to inspect your web browsers network tab, and see what the request returns when the save button is submitted? If not, Is your server publicly accessible and are you able to provide me temporary access to the wordpress admin area?

AS

Andreas replied

1 year ago on December 8, 2022 at 4:59 pm

When I go to the "Templates Fields" Step, some of the same errors occur:
jquery.min.js?ver=3.6.1:2          POST https://dev.andreas-stricker.at/swandoo/wp-json/iwp/v1/importer/9337/field 500

I think these are the custom fields which aren't stay filled (but the name of these fields is correct)

When saving there's no JS error

J

James replied Support Agent

1 year ago on December 8, 2022 at 5:05 pm

Does your server have an error log file, the "500" error should be logged somewhere?

AS

Andreas replied privately

1 year ago on December 8, 2022 at 5:41 pm

AS

Andreas replied privately

1 year ago on December 8, 2022 at 5:53 pm

J

James replied Support Agent

1 year ago on December 8, 2022 at 5:57 pm

When i run this on an empty server, i get a warning:

PHP Warning:  Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini.

Can you go to Tools > Site Health > Info , and under the server section, if the "PHP max input variables" is 1000, changing this to 3000 or greater allowed the importer to save with the new fields and run the import.

AS

Andreas replied

1 year ago on December 8, 2022 at 6:07 pm

This solved the problem!
I couldn't see the PHP Warning - but now with increasing it, it works! Thank you!