warning: Illegal offset type in isset or empty in insert.module on line 194
Getting the message in the title when editing, or saving any node using insert for cck image fields.
The line in question reads:
if (!isset($insert_styles[$default])) {
$insert_styles[$default] = $default;
}
I've dsm($default)
- its the preset form imagecache, and it is an Array; I guess that's why it throws this warning, because its not a string.
The array looks like [0] => 'presetname'
As how to go about fixing this properly, I leave it up to you guys that know the inside out of this module better than me... willing to test patches, or if you have a pointer as to how to do it, I can work on it and provide one myself =)
Comments
Comment #1
quicksketchIt sounds like something went wrong when Insert tried to save the field settings. The default style is supposed to be configured via a select list on the field configuration page. If you're getting an array instead of a string, then somehow an array was returned by this select list instead of a string. This problem doesn't exist on a clean installation of Drupal/FileField/Insert.
Comment #2
Manuel Garcia CreditAttribution: Manuel Garcia commentedThanks quicksketch for the quick reply, I will try debug it further on our install.
Comment #3
Manuel Garcia CreditAttribution: Manuel Garcia commentedOK, I think I've found what was causing this warning message, here is what the situation was for this imagefield configuration:
This was causing the warning apparently, for when I selected the Enabled insert styles that we needed, the warning stopped appearing.
Not sure wether the module should account for this situation or not, but in any case, I hope my comment here helps anyone that encounters this situation.
Thanks again for the quick reply!
Comment #4
quicksketchThis problem has already been fixed in CVS as part of #661426: What is you have a WYSIWYG field that isn't the body?. The default style is now acts as if it always enabled, even if it hasn't been explicitly checked. So when the next version comes out this won't be a problem again.
Comment #5
Manuel Garcia CreditAttribution: Manuel Garcia commentedawesome qucksketch, thanks! -- glad this was a non-issue =)
Comment #7
sbayne CreditAttribution: sbayne commentedI'm getting this same error, but only when the field is part of a flexifield:
1. Flexifield node has wysiwyg field, and insertable graphic field.
2. There are multiple Flexifield nodes in a parent node.
3. There is another wysiwyg field and insertable graphic field in the parent node.
The error comes up on ALL insertable graphic fields.
When I create a flexifield node by itself, the error does not come up.
Comment #8
BrightBoldFor anyone else troubleshooting this issue: you will also receive this error if somehow all your Enabled Styles get unchecked and you are saving a document that already had styles applied. The fix, of course, is easy - re-enable the styles.
Comment #9
quicksketchI don't really support Flexifield, but any patches I'd be happy to look at. I probably won't be installing the module to correct that problem.
Comment #10
quicksketchSome similar problems when users update the module have also been encountered, a la #881964: Illegal offset type in isset or empty in...... (marked as duplicate).
Comment #11
wwatson13 CreditAttribution: wwatson13 commentedThis issue is still there in beta6, I was getting this warning until I reactivated the styles for the different content types.
Comment #12
quicksketchNo updates in a while, as stated I don't support Flexifield. Please open a new issue if this problem is still occurring.
Comment #13
bbenone CreditAttribution: bbenone commentedI just bumped into this in 6.x-1.1.
Somehow, what I had set in the "ENABLED INSERT STYLES:" for my image field was erased. Not real sure how that happened, but it resulted in this exact same warning message.
Additionally, the Insert button itself stopped working. Clicking it just did nothing.
Following the steps above in comment #3 resolved the issue. I just had to resave the image field settings with something enabled.
Incidentally, I tried clearing out the enabled styles again and re-saving with nothing enabled, but I can't reproduce the issue. Even with nothing saved, it works fine. Mine must have been referencing options that no longer existed (deleted image cache setting maybe??).
I'm re-opening, but marking low priority since there is a resolution path above. I can't reproduce, so feel free to re-close if you want.
Comment #14
anschinsan CreditAttribution: anschinsan commentedI ran into this error in 6.x-1.1. after exporting the Content type with CCK content copy. During this export, my field settings where deleted.
Comment #15
BrightBoldJust to be clear, I've never used Flexifield, so this must happen in other situations too. My situation was similar to that in #13 — something disabled all the enabled styles. Unfortunately I don't know what I had done prior to getting the error that might have been responsible for everything getting disabled. Maybe it was an export as in #14? I just know it wasn't related (in my case) to Flexifield.
Comment #16
j_byrd CreditAttribution: j_byrd commentedJust happened out of the blue for me. No flexfield.
Comment #17
spgd01 CreditAttribution: spgd01 commentedSame situation here.
If I check an Enabled insert style the same as the default style the error goes away.
Comment #18
quicksketchThis probably happens when a field is configured to insert a specific ImageCache preset, but then that preset is deleted. Now there aren't any presets defined that are valid, so the error is thrown(?) Just guessing here. I thought we already were accommodating for this situation. Doesn't seem like it's happening regularly for people.
Comment #19
bisonbleu CreditAttribution: bisonbleu commented@quicksketch, good detective work. As it turned out in my case, the Enable insert button was checked while no Enabled insert styles were selected. The errors I was getting appear below. Thanks!
Comment #20
Snater CreditAttribution: Snater commentedClosing as D6 version is not supported any more.