After first uninstalling Location (deleted all Location CCK fields from content and references in Views, or thought I did; deactivated module; uninstalled it), and then re-installing it, I was getting this error message everywhere.
Fatal error: Cannot use string offset as an array in /var/www/drupal/sites/default/modules/location/contrib/location_cck/location_cck.module on line 348
Looking into that line in the code and doing some print_r's, the value of $field did not seem to have anything defined for 'location_settings'. The key existed in the array, but it had no value.
I tried doing this on a clean install, and it worked fine.
There must be something funky with my settings, or the modules I have installed were adding a wrinkle. I have lots of them, but I think the only pertinent ones are:
Drupal 6.16
CCK 2.6
Date 2.4
Location 3.1-rc1
Phone CCK 2.16
Content Taxonomy 1.0-rc2
Content Profile 1.0
Views 2.1
Realname 1.3
Registration Codes 2.2
lots of others...
Commenting out the original line and returning a blank array() managed to remove the WSOD...
//$hide = array_keys(array_filter($field['location_settings']['display']['hide']));
$hide = array();
Once I got there, an address field had shown up in my content type after I thought I had removed it when uninstalling. (Perhaps that was the problem?) Removing it again, creating a new address field, saving the content type and then changing the $hide code back to the original seems to have made things normal again.
Not sure what the expected behaviour is, whether if uninstalling a CCK datatype should delete the data in the content types - I'm guessing it shouldn't. But turning it back on again seemed to confuse things.
No idea if this was user fault or not, but just posting this here in case anyone else runs into the same problem...
Comments
Comment #1
yesct commentedComment #2
miletus commentedHi,
I get this same error everytime I create a node content type that has a location w/ gmap attribute. I could never create my any content. So I disabled locationCCK in the cck module. I was then able to avoid the error and create content, however, I could never get my gmap flags to display as in the drupal therapy video for location/gmap.
I am a newbie following the drupal therapy video instructions, and never got things to work, so I started OVER from scratch to follow the video w/ a new install. This time I did NOT enable locationCCK since the video doesn't specifically say so, and was able again to create content that had a gmap attribute but it never worked like the video, ( I didn't use story exactly like the video, instead I created a new content type that had the gmap attributes) (but still no flags on my map nor pretty pop-ups, etc) . So then I was reading the textbook "drupal 6 site blueprints" ch 11 building a google map site, and it specifically said to enable cck locationCCK for the gmap/location features so I went to admin and enabled cck's locationCCK. This time, I already had content created that is using the gmap/location stuff and now I am in BIG trouble. Before I use to get the error only when I attempted to create content, but Now I can't even get to my admin screen. I am totally HOSED. I type in my home page and all I get is the error:
Fatal error: Cannot use string offset as an array in /home/mydir/public_html/1/sites/all/modules/location/contrib/location_cck/location_cck.module on line 348
I can't even access my home admin page. Is there something I can do to the database so I can get back to my website???
Comment #3
miletus commentedthank you for the detailed code listed above. I entered that in and was able to access my admin page. thank you! Immediately went in and disabled cck's locationCCK. No more fatal error.
Comment #4
ankur commentedI was unable to reproduce this issue. Perhaps it was fixed in a different ticket?