The constructor for MigrateListFiles says the $file_mask parameter is optional:

  public function __construct($list_dirs, $base_dir, $file_mask = NULL, $options = array(), MigrateContentParser $parser = NULL, $get_contents = TRUE) {

but if this is omitted, the NULL default is then passed to file_scan_directory():

      $files = array_merge(file_scan_directory($dir, $this->fileMask, $this->directoryOptions), $files);

which then complains:

> Warning: preg_match(): Empty regular expression in file_scan_directory() (line 2127 of /includes/file.inc).

Comments

joachim’s picture

Status: Active » Needs review
StatusFileSize
new1.46 KB

Here's a patch.

It changes the functionality -- currently if you don't pass a $file_mask, no files match and you get a warning. I presume this is undesirable, as all it does is point out to you that you've not set up the constructor properly. The new behaviour is that if you pass in nothing, all files match. Happy to reroll if that's not what you want :)

  • mikeryan committed bae0887 on 7.x-2.x authored by joachim
    Issue #2541996 by joachim: Prevent NULL file_mask being passed to...
mikeryan’s picture

Status: Needs review » Fixed
Issue tags: +Migrate 2.9

Committed, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.