Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Option to preserve STRUCTURE url_title on import

Status Resolved
Add-on / Version DataGrab 4+
Severity
EE Version 6+

Paul Larson

Nov 12, 2022

We import eCom items via cron from an ERP.

Say a product exists:

Title: SKU1234
Product name: My amazing product
Structure_url_title: my_amazing_product
Native url_title: my_amazing_product

When I run the Datagrab import, the above becomes:

Title: SKU1234
Product name: My amazing product
Structure_url_title: sku1234

<----------
Native url_title: my_amazing_product

This is enough to make the item 404.

To get past this, I seem to have made this hack to the prior DataGrab:

screenshot:

https://www.dropbox.com/s/x1ffvl9xuekfii2/2022-11-12_13-59-23.png?dl=0

raw text:
Approx line 362 in old DG, datagrab_model.php

$data[“cp_call”] = TRUE;
// PGL Hiding below so DataGrab doesn’t un-set the Structure URL
// $data[“structure__uri”] = url_title( strtolower( $data[“title”] ) );
$data[“structure__template_id”]= $row[“template_id”];
$data[“structure__parent_id”] = 0;

I don’t know _why_ that worked; or maybe I got lucky and it was something else. But worth checking there.

#1

BoldMinded (Brian)

Paul, try this build on a local or dev site. It has a new section to configure the Structure import options.

https://www.icloud.com/iclouddrive/099FCH8kDw7SiQQnVJJDz3gow#datagrab-4.2.0a-module-handler-9257fe07

#2

BoldMinded (Brian)

New options to manage the Structure data on import were added in version 4.2

#3

Paul Larson

I’m on 4.2.1 but still having the behavior where DataGrab reverts/defaults a Structure URL title, which I need to maintain.

Screenshot of live vs dev after the important.

https://www.dropbox.com/s/it7fwkxeilp9jb9/2023-01-03_19-49-25.mp4?dl=0

Ideally the Structure URL would remain untouched.

#4

Paul Larson

Comment has been marked private.

#5

BoldMinded (Brian)

There is a whole section to configure the Structure settings but I didn’t see its settings in the video… what do you have them set to? Have you tried adjusting the settings?

https://www.dropbox.com/s/warsy8tzkswsgh6/ticket-2527-structure-settings.png?dl=0

#6

Paul Larson

Ah! I see it now.

#7

Paul Larson

I assume DG only shows the settings if the channel uses Structure? Makes sense, but might be why I didn’t notice it.

Login to reply