I checked this error. And the problem is this piece of code:
if (file_prepare_directory($dir, FILE_CREATE_DIRECTORY)) {
$file = file_save_data($contents, 'public://js/gmap_markers.js', FILE_EXISTS_REPLACE);
variable_set('gmap_marker_file', $file->fid);
}
Apparently $file can be empty and thus not being an object, resulting in the error.
This must be corrected into this:
if (file_prepare_directory($dir, FILE_CREATE_DIRECTORY)) {
$file = file_save_data($contents, 'public://js/gmap_markers.js', FILE_EXISTS_REPLACE);
if (!empty($file)) {
variable_set('gmap_marker_file', $file->fid);
}
}
Comments
Comment #1
phoenix commentedAnd here's the patch :)
Comment #2
phoenix commentedComment #3
quocnam15 commentedThanks so much
Comment #4
Refineo commentedI also got this error today :
I am using gmap latest dev. Is the patch included in the latest dev ?
Drupal 7.12
Comment #5
tusharbodke commentedThanks a lot Patch works fine for me and save my life!!!
Comment #6
mstef commentedLooks good - thanks
Comment #7
bdragon commentedInteresting, that has gotta be what was causing the sporadic disappearance of the marker cache that I've been seeing.
Fixed in 7.x-1.x-dev and 7.x-2.x-dev, thanks!