CMS MADE SIMPLE FORGE

Module Generator

 

[#8463] Do not create modulename/id/ folders unless required in Uploads folder

avatar
Created By: Cameron (smokeycam)
Date Submitted: Sun Sep 30 20:36:50 -0400 2012

Assigned To: Zdeno Kuzmany (xxl)
Version: 2.2.3
CMSMS Version: 1.11.2
Severity: Trivial
Resolution: None
State: Open
Summary:
Do not create modulename/id/ folders unless required in Uploads folder
Detailed Description:
Hi there,

Appears the module seems to generate a gallery folder in the uploads folder for
each item ID even though there are no files(s) or Gallery associated with that
module to that directory.  For example, If a field definition (select file
looking for /uploads/images/banners) is not looking at that specific directory,
it still generated.

I modified the code on action.default.php lines 599 to 604 to the following:

 // Only create directories if gallery exists...
        if ($mod->GetPreference('has_gallery')) {
$onerow->file_location = generator_tools::file_location($this, $row);
           $item_gallery = new generator_item_gallery($mod, $row["item_id"]);
           $images = $item_gallery->load_files();
           $onerow->images = $images;
        }

I am not 100% sure if this is correct or if it could have some implications on
other custom modules that use the self creating directory with custom field
definitions.

Hope that makes sense?

Cheers


History

Comments
avatar
Date: 2012-10-01 20:39
Posted By: Cameron (smokeycam)

And function.admin_itemtab.php from line  362...

         // Only create directories if gallery exists...
    if ($mod->GetPreference('has_gallery')) {
    $onerow->file_location = generator_tools::file_location($mod, $row);
$onerow->filepath_location = generator_tools::filepath_location($mod, $row);
    }
      
avatar
Date: 2012-10-14 18:22
Posted By: Cameron (smokeycam)

oh and action.detail.php lines 68ish

$item = cge_array::to_object($row);
$item->file_location = generator_tools::file_location($mod, $row);

Replaced with..

if ($mod->GetPreference('has_gallery')) {
    $item->file_location = generator_tools::file_location($mod, $row);
}
      
Updates

Updated: 2012-10-01 20:39
resolution_id: => 5