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: Entry with ‘Open’ status changes to ‘Draft’ (channel default) on import

Status Resolved
Add-on / Version DataGrab 4.1.0
Severity
EE Version 6.4

Paul Larson

Nov 10, 2022

Entry channel default is: Draft. (new items need to be draft, as DG creates them but user needs to fill out title, image, desc, etc)

When I run the cron, an entry’s _content_ is updated. But ‘open’ entries, which DG touches, are being set to Draft.

 

 

#1

Paul Larson

Comment has been marked private.

#2

Paul Larson

It’s almost as if it’s applying the channel entry default at all costs. When it should only be applied for New entries.

Same as: https://boldminded.com/support/ticket/2522

#3

Paul Larson

Comment has been marked private.

#4

BoldMinded (Brian)

Can you give me an example of your import file? Just 1 or two entries worth is fine.

#5

BoldMinded (Brian)

The only change I’ve made to anything relevant to the entry status since I acquired Datagrab is adding this conditional on line 1543 a few weeks ago to fix another issue. Try commenting it out and see if it fixes your issue.

// If someone used a custom field with the capitalized versions, correct it.
            // Internally these statuses should always be lowercase.
            if (in_array(strtolower($status), ['open', 'closed'])) {
                $status = strtolower($status);
            }
#6

Paul Larson

Comment has been marked private.

#7

Paul Larson

Pasted a few rows. Hopefully the TABs come through.

#8

Paul Larson

My channel statuses are Open| Closed | draft

Today it’s sticking out that draft is lowercase, but that may not have any bearing.

#9

BoldMinded (Brian)

Did you try commenting out that conditional in comment #5?

#10

Paul Larson

Unfortunately, no. Items still being set to ‘draft’ when they begin as ‘Open’

#11

Paul Larson

Sorry, messages passing in real time. Yes, I commented it. No, it doesn’t fix.

#12

BoldMinded (Brian)

FWIW I’m not able to replicate this locally. I changed my test channel default status to “draft”. Newly imported entries get the draft status, existing entries in that channel still have “Open” as the status.

#13

BoldMinded (Brian)

Do you have any rows with “ajw_datagrab_fetch_status” in your exp_extensions table?

#14

BoldMinded (Brian)

I’m curious as to why this is suddenly an issue for 2 people because as mentioned I haven’t touched the code that handles the status, except to add that case sensitivity check mentioned above. To me this seems to be a long standing issue, and one that I’m not able to replicate.

#15

Paul Larson

Comment has been marked private.

#16

Paul Larson

Comment has been marked private.

#17

BoldMinded (Brian)

It’s only importing 1 at a time because you have limit=1 on your ACT URL. Try setting it to 9999 or something really high.

#18

BoldMinded (Brian)

When you set the import limit in the CP to a blank value, it should have been defaulting back to 1. So you need to make the limit really high.

#19

BoldMinded (Brian)

Try running the imports in the CP, not through the CLI with the ACT parameter URL.

#20

Paul Larson

Sure, I can try that for the purposes of debugging; but it needs to be cron in production.

#21

Paul Larson

Comment has been marked private.

#22

BoldMinded (Brian)

Can you share the actual import file with me? Just a smaller version with 2 or 3 entries. I’m afraid if I copy the text out of comment #6 it won’t come through correctly, so I need an actual file.

#23

Paul Larson

Comment has been marked private.

#24

BoldMinded (Brian)

I’m able to replicate the issue, but I’m still 99.9% certain nothing has changed from the old Ajw DataGrab and the version I have. If you’re seeing different behavior then I can’t explain that. I’m comparing the 2 codebases and it’s determining the status the same way it has always been, and based on the behavior you’re seeing this is effectively a feature request because it involves another config option to determine if if should update or leave the status of an existing entry. Right now, and based on the old code I’m looking at, it will always use the channel default, regardless if it’s a new or existing entry, or whatever status is set in the import file itself.

#25

BoldMinded (Brian)

Try the build in the next comment. It has a new option field.

https://www.dropbox.com/s/toti4ny97u0f9xc/ticket-2526-a.png?dl=0

#26

BoldMinded (Brian)

Comment has been marked private.

#27

BoldMinded (Brian)

Paul, have you been able to try the new build I sent? It should alleviate both issues you’re having by using the new options in the import config.

#28

BoldMinded (Brian)

Version 4.2 provides new options to manage when the status field is updated.

Login to reply