This one is part of META issue #1931138: Fixing all 'single marker' issues
Around gmap.module, line 555, i get warnings sometimes cause permissions are wrong on gmap_markers.js file. When that occurs, $file is false, so accessing $file->fid is wrong. May be is necessary to catch that kind of error and show a better error message. For example:
// Make sure js/ exists in the files folder.
if (file_prepare_directory($dir, FILE_CREATE_DIRECTORY)) {
$file = file_save_data($contents, 'public://js/gmap_markers.js', FILE_EXISTS_REPLACE);
if ($file === false)
drupal_set_message(t('GMap is unable to save the marker bundle. Please check gmap_markers.js permissions!'), 'error');
else
variable_set('gmap_marker_file', $file->fid);
}
else {
drupal_set_message(t('GMap is unable to save the marker bundle. Markers will not work!'), 'error');
}
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | saving_gmap_markers-1167594-6687672.patch | 1.36 KB | max-kuzomko |
| #3 | 1167594-3_saving_gmap_markers.patch | 1.39 KB | wojtha |
| #2 | 1167594_saving_gmap_markers.patch | 611 bytes | wojtha |
Comments
Comment #1
zoen commentedAgreed. Lack of permissions to save gmap_markers.js made my site all errory too. Javier's proposed solution didn't work for me, though - the file_save_data() fail on line 554 made my page error out with Unexpected Error badness. I guess that's what the file_prepare_directory() call is supposed to check for. Evidently it needs more checking.
Comment #2
wojtha commentedComment #3
wojtha commentedBetter error message incl. watchdog.
Comment #4
hutch commentedYou might want to stop it regenerating the title markers as well on fail (while your'e on a patching roll).
Comment #5
podarok#3
needs reroll against latest dev
Comment #5.0
podarokUpdated issue summary.
Comment #6
max-kuzomko commentedComment #7
max-kuzomko commentedComment #8
max-kuzomko commentedFixed #5
Comment #9
valentine94Great - RTBC!
Comment #12
podarokthanks, merged