Fresh install of importexportexportapi.module results in multiple "Illegal offset type" warnings on both admin/import and admin/export screen. Rest of the UI appears normally after the warnings.

48 counts of:

# warning: Illegal offset type in /Users/garrett/Work/sandbox/drupal-5.1/sites/all/modules/importexportapi/importexportapi.module on line 567.

(strange, the module only has 565 lines of code)

and 20 counts of:

# warning: Illegal offset type in /Users/garrett/Work/sandbox/drupal-5.1/sites/all/modules/importexportapi/importexportapi.module on line 364

Version info:

Drupal 5.1
Import Export API 5.x-1.x-dev
MySQL 4.1.21
PHP 4.3.4
Apache 1.3.33
Mac OS X 10.4.9 (PPC)

Comments

solarkin’s picture

I am having the same issue.

garrettc’s picture

Version: 5.x-1.x-dev » 5.x-1.0

Tested against the newly released 5.x-1.0 and still seeing the same problems.

douggreen’s picture

Assigned: Unassigned » douggreen

I can't reproduce this. Can you narrow down the export to one particular "entity" causing each of the errors? It's possible that it's the same field definition causing both, but with each error, there's something missing in the field definition for some particular "entity" type being exported.

Yesterday jaza updated all of the field definitions, so it's possible he missed something. If you can narrow this down, it will be a lot easier for me to fix. Thanks!

garrettc’s picture

These errors are appearing after a fresh install, before any import or export had been performed, but after looking at the export screen again I noticed that the custom CCK types I had created weren't appearing, instead it was displaying "Array" next to the checkboxes.

On a hunch I disabled all the CCK modules and now the errors have vanished. Looks like a conflict with CCK perhaps?

douggreen’s picture

That's not surprising. However, I have the latest CCK and am not getting the errors. Please make sure your site is up to date by running your sites update.php. You said "These errors are appearing after a fresh install, before any import or export had been performed". What page? every page? export page?

garrettc’s picture

They are appearing on both /admin/build/export and /admin/build/import, nowhere else.

The site is completely up to date. /update.php isn't showing any outstanding database upgrades.

Would it help if I exported out my content types (8 in total)and attached them to this issue? I'm thinking there is something in one of them that's triggering the warnings.

douggreen’s picture

Can you isolate which one is causing the problem, then export that one only?

TallDavid’s picture

I am also seeing the same error messages on a fresh Drupal 5.1 installation. FYI.

garrettc’s picture

Okay, this is where I'm up to:

- Disabled all 'standard' modules that I was using that provide an entry under /admin/content/types. Blog, Forum and Image

Errors still appearing.

- Deleted each custom content type one at a time.
- After each deletion check /admin/build/export and /admin/build/import

Errors still appearing

- Deleted final entry under /admin/content/types

Errors all gone!

I tried this routine a number of different ways, ensuring that the last deletion was a different content type each time. And each time the errors only vanished when the last entry was deleted.

Solarkin, TallDavid: could you try the above methodology and see if you get the same result as me, ie: the errors go away when either CCK is disabled or all content types are deleted (you might want to back up your database first *:)). That might get us closer to a reproducible test case.

manifold’s picture

Warnigs disaper when i disabled CCK modules. And by the way, some checkboxes were labeled as "Array" is this normal? Maybe you shoud check CCK compatability?

I get lots of this:
# warning: Illegal offset type in /home/***/dolphin.serebrennikov.com/www/sites/all/modules/importexportapi/importexportapi.module on line 567.

and then lots of this:
# warning: Illegal offset type in /home/***/dolphin.serebrennikov.com/www/sites/all/modules/importexportapi/importexportapi.module on line 364.

Entities to import looks like this:

Entities to import: *
Input format
Filter
Menu item
Node type
Array
Array
Array
Array
URL alias
Variable
Vocabulary
Term
User role
User
Watchdog log message
Content field
Content type
advertisement
banner
Image
Block
Block (custom)
Array
Node access rule
File
Comment

manifold’s picture

Messages disapeared when i deleted "definitions/contrib/cck" folder.

solarkin’s picture

I received the same results as garrettc following his process.

garrettc’s picture

I can confirm manifold's method. Removing definitions/contrib/cck makes the errors disappear.

solarkin’s picture

Removing definitions/contrib/cck did it for me also.

douggreen’s picture

I can confirm that the cck definitions were missed in the D5 upgrade. Thanks everyone for your help in isolating the problem! If anyone else wants to post a patch, it will get applied sooner than later. Otherwise, I'll try to get if fixed sometime within the next week (I just got home from OSCMS after 8 days out-of-town).

garrettc’s picture

Unfortunately this kind of PHP is way beyond my level of expertise. I'm a front end person and only know enough to feel comfortable with building theme functions. However, I will make myself available to test any patches that come through.

j0k3z’s picture

Same issue.

Is it safe to just delete this folder or what should I do?

douggreen’s picture

If you're not importing or exporting CCK, userreference, or nodereference content, then yes you can temporariliy remove this directory without causing harm.

benma’s picture

subscribing

douggreen’s picture

Title: "Illegal offset type" warnings on import and export screens » CCK definitions not upgraded to D5

title was '"Illegal offset type" warnings on import and export screens'

ray007’s picture

subscribing

manifold’s picture

subscribing

rup3rt’s picture

subscribing

designerbrent’s picture

subscribing

jjjames’s picture

subscribing?!

themselves’s picture

gnibircsbus

wolfderby’s picture

subscribing

michelle’s picture

Yet another subscriber. :) Since CCK is what I'm looking to export/import, I want to see when this gets fixed.

Michelle

lilou’s picture

me too ...

rfarm’s picture

subscribe

WebWeasel’s picture

subscribe

ray007’s picture

I've done a bit debugging and found the source of the problem:

in .../definitions/contrib/cck/importexportapi_content.inc function content_def() line 116 you get a list of contenttypes.
The function content_types() returns an array with all content types, not only cck-managed ones.

in importexportapi.module function importexportapi_set_def() line 186 you do array_merge_recursive() on the definition results, which ruins the $def array as soon as the content-module is processed.

If you replace that line with
$def += $def_temp;
the warnings go away and the checkbox-list looks fine.

Haven't yet tested test exporting/importing ...

douggreen’s picture

Status: Active » Fixed

Thanks Ray! That was close. The fix is actually in importexportapi_content.inc. I've checked in a new version to the 5.x-dev branch. If this works I'll make a new 5.x-1.1.

garrettc’s picture

I can confirm that the latest dev version (checked out via CVS) seems to be working okay. All the errors are gone and content types are appearing correctly.

frost’s picture

Version: 5.x-1.0 » 5.x-1.x-dev

Can also confirm that latest dev version gets rid of those errors on the Export screen, but the "Product" content type (from ECommerce) doesn't appear in the list of entities to export. I *think* it was appearing when the errors were there!

douggreen’s picture

Thanks everyone. I've created a 5.x-1.1 release.

Anonymous’s picture

Status: Fixed » Closed (fixed)