• file maxbgalleria-media-library.php, find private function get_folders, replace entire definition with:

    
      private function get_folders($path) {
        $sub_folders = explode('/', $path);
        foreach($sub_folders as $id => $folderName)
          if ( $folderName === $this->uploads_folder_name )
            return array_slice($sub_folders, $id+1);
        return [];
      }
    

    Not sure if it returns the correct data on failure (please tweak to taste), but it’ll fix the infinite loop you have in there (array_shift won’t fail to shift an empty array, so if it never matches, it never returns)

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author AlanP57

    (@alanp57)

    I’ll take a look at this the get_folders function when time permits. Is there anything unusual in your configuration, such as renaming the uploads folder, that contributed to the infinite loop?

    Thread Starter ellmann creative

    (@ellmanncreative)

    Not that I’m aware. I do run a multisite, however, and this occurs when I attempt to Network Activate the plugin.

    Also, I made a typo in the filename – there’s an extra b there, the filename should of course be

    maxgalleria-media-library.php

    Plugin Author AlanP57

    (@alanp57)

    Can you the line number of the typo?

    Thread Starter ellmann creative

    (@ellmanncreative)

    No, that was my typo in the first post — I wrote “maxbgalleria-” when it should be “maxgalleria”.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Plugin can’t be activated because it triggered a fatal error (fix)’ is closed to new replies.