The error below sometimes throws a 500 when editing a context.
Warning: preg_match(): No ending delimiter '.' found in file_scan_directory() (line 2085 of /nusa/drupal7/www/includes/file.inc).
in: sites/all/modules/context_addassets/context_addassets.module
296 $modules = variable_get('context_addassets_index_modules', array());
297 foreach ($modules as $path) {
298 if (!$path) continue;
299 $dir = realpath('.') . base_path() . $path;
300 $mask = ".+\." . $filetype;
301 $files_raw[$path] = file_scan_directory($dir, $mask);
302 }
303 break;
needs to be changed to:
296 $modules = variable_get('context_addassets_index_modules', array());
297 foreach ($modules as $path) {
298 if (!$path) continue;
299 $dir = realpath('.') . base_path() . $path;
300 $mask = "/.+\." . $filetype . "/";
301 $files_raw[$path] = file_scan_directory($dir, $mask);
302 }
303 break;
The mask is a regular expression that needs the enclosing /.
Patch attached.
Comments
Comment #1
SolomonGifford commentedComment #2
jtwalters commentedI believe this is fixed in the latest development snapshot (c07555a0f93ae850381c8a7513badeb1bea5318e).
Comment #3
jtwalters commented