• I am running https://localwp.com/ which runs WordPress in Windows. When I click Select Register, I get two errors:

    1. Fatal error: Uncaught UnexpectedValueException: RecursiveDirectoryIterator::__construct(C:UsersuserLocal Siteslobsterapppublicwp-contentuploadscovers,C:UsersuserLocal Siteslobsterapppublicwp-contentuploadscovers): The system cannot find the file specified. (code: 2) in C:\Users\user\Local Sites\lobster\app\public\wp-content\plugins\bulk-media-register\lib\class-bulkmediaregister.php on line 121
    2. ( ! ) UnexpectedValueException: RecursiveDirectoryIterator::__construct(C:UsersuserLocal Siteslobsterapppublicwp-contentuploadscovers,C:UsersuserLocal Siteslobsterapppublicwp-contentuploadscovers): The system cannot find the file specified. (code: 2) in C:\Users\user\Local Sites\lobster\app\public\wp-content\plugins\bulk-media-register\lib\class-bulkmediaregister.php on line 121

    I think it is related to how Windows handles directories. In Bulk Media Register, the drop-down box of directories is formatted differently for Windows and Linux (note the use of / and \ ):

    • Windows&lt
      wp-content/uploads\generatepress
      wp-content/uploads\covers
    • Linux
      wp-content/uploads/generatepress
      wp-content/uploads/covers
    • This topic was modified 4 years, 2 months ago by iantresman.
    • This topic was modified 4 years, 2 months ago by iantresman.
Viewing 1 replies (of 1 total)
  • Plugin Author Katsushi Kawamori

    (@katsushi-kawamori)

    I don’t think it’s a matter of the path, since the following functions are used this plugin.

    https://developer.www.ads-software.com/reference/functions/wp_normalize_path/

    lib/class-bulkmediaregister.php
    line 117-122 and line 242-247
    If you change it as follows, it may work.

    Before

    $iterator = new RecursiveDirectoryIterator(
    	$dir,
    	FilesystemIterator::CURRENT_AS_FILEINFO |
    	FilesystemIterator::KEY_AS_PATHNAME |
    	FilesystemIterator::SKIP_DOTS
    );

    After

    $iterator = new RecursiveDirectoryIterator(
    	$dir,
    	FilesystemIterator::CURRENT_AS_FILEINFO |
    	FilesystemIterator::KEY_AS_PATHNAME
    );
Viewing 1 replies (of 1 total)
  • The topic ‘Fatal error’ is closed to new replies.