CMS MADE SIMPLE FORGE

Extended Content Blocks 2

 

[#12259] File selector php error when recurse is not set

avatar
Created By: Remco (flmm)
Date Submitted: Thu Feb 20 20:20:08 -0500 2020

Assigned To: Chris Taylor (chrisbt)
Version: v1.5.3
CMSMS Version: 2.2.12
Severity: Minor
Resolution: None
State: Open
Summary:
File selector php error when recurse is not set
Detailed Description:
Great module and use it alot. Love the file_selector but had a small problem
when adding it to a new site today.

This probably has something to do with CGExtensions 1.65.1 also, because I never
had this problem before. But when recurse is not set I get a white page and the
following error in the logs: "cge_dir::recursive_glob() must be of the type
integer, string given".

Traced it back to modules/CGExtensions/lib/class.cge_dir.php line 276 where I
noticed it had something to do with the int for recurse.

Maybe this can be given a default value. I fixed it for now by changing line 254
in class.ecb2_tools.php from

$fl = cge_dir::recursive_glob($dir, $filetypes, 'FILES', $excludes,
$this->options['recurse']);

to

if (isset($this->options['recurse']) && $this->options['recurse'] != ''){
  $recurse = $this->options['recurse'];
}
else {
  $recurse = '-1';
 }
$fl = cge_dir::recursive_glob($dir, $filetypes, 'FILES', $excludes, $recurse);


History

Comments
avatar
Date: 2020-02-21 14:05
Posted By: Chris Taylor (chrisbt)

Hi Remco, 

Thanks for the feedback. Glad you like the module. I did too when it was still
ECB so I had to keep it alive, and I took over the development / maintenance.

The use of CGExtensions is from the previous ECB version, I have a partly
updated version of ECB2 that uses a core function instead of CGExtensions. Seems
to work well and I can drop the dependency on CGExtensions for this module.

Will have a few other upgrades included, plus have some major updates for the
next phase of development.

Cheers

Chris
      
avatar
Date: 2020-02-21 19:02
Posted By: Remco (flmm)

Thanks for the update. If you need someone to help and test. Let me know :).