I’m using datagrab 1.9.2 on EE 2.10.1 with MSM. I have an xml import that’s working fine overall, however, in some instances datagrab is selecting the wrong entry. Basically it’s grabbing an entry for site id 1 instead of site id 2, the site datagrab is importing on. Here are the details.

I have site 1 & 2. Each site shares an entry titled Plan 2100 (same entry title, different content). The entry id of the Plan 2100 on site 1 is 7264 and for site 2 it’s 1466. I’m importing these entries into a matrix with a playa field (I attached a screenshot so you can see the setup). Everything is working perfectly except for these two entries that share the same entry title.

It appears datagrab isn’t honoring the site id. When I run the import on site 1, it inerts the plan 2100 entry with the entry id for site 2—id 1466 instead of 7264. My thinking is datagrab should ignore the data for other site ids other than the site it’s running on. However, this doesn’t seem to be the case.

I’ve looked in the database and this is how I discovered the wrong entry id was being selected upon import.

If I go into the EE CP it looks like the correct entry is selected in the playa drop down, but it is fact the wrong entry id, and won’t display in the front end. If I reselect the entry title in the playa drop down and save, it works correctly and it chooses the correct entry id.

I've confirmed my playa field setup is limited to entries of the site I'm on.

So, in a nutshell, it appears datagrab isn’t honoring the site id for some entries using a matrix/playa combo. Has anyone else experienced this problem and perhaps found a solution? Please let me know if you need further explanation.

Thanks for your help!

Matrix with a playa field.

More info added: Here are some screenshots from the database to help understand the issue.

In this screenshot I've retrieved all entries with an entry title of Plan 2100. There are two results, one for site_id 1 and one for site_id 2.: http://screencast.com/t/daZVAYOf enter image description here

After importing the XML via datagrab, you can see the Plan 2100 from site_id 2 was incorrectly inserted into site 1. Then, in the CP, I re-selected Plan 2100 from the playa drop down and this resulted in the addition of the Plan 2100 from site_id 1 being added to the matrix: http://screencast.com/t/sGNNq0N0i enter image description here

1 Answer 1


I fixed this by inserting the following after line 213 in datagrab_matrix.php:

$this->EE->db->where( 'site_id', $this->EE->config->item('site_id') );

Basically the datagrab import wasn't taking the site_id into consideration.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.