zikula-modules / Formicula

A template-driven form mailer for Zikula
https://ziku.la
19 stars 7 forks source link

Change cache directory #70

Closed Guite closed 4 years ago

Guite commented 8 years ago

Instead /app/cache/formicula use /web/formicula

craigh commented 8 years ago

this may be harder than I thought. Writing files to /web is not easily done because of user rights. This could probably be overcome with appropriate .htaccess files, but maybe that is the wrong approach.

MrMontesa commented 8 years ago

Just found out that Zikula bails out with error 500 in case /app/cache/formicula folder does not exist. A nice error message would be more appropriate. Possibly consider this when moving the folder. Thanks

craigh commented 8 years ago

if you have debug: true or env: dev then your error messages won't be pretty. This is why zikula ships with debug: false and env: prod

MrMontesa commented 8 years ago

Thats correct. I observed this error while debug: false and env : prod were set. Its also the reason why I havent provided full stack trace in my first post.

Guite commented 8 years ago

In my tests the directory was automatically created during installation. https://github.com/zikula-ev/Formicula/blob/master/FormiculaModuleInstaller.php#L238 If this is not successful an error message is created.

MrMontesa commented 8 years ago

Then I think its a corner case of the upgrade procedure. One is asked to blank the installation folder, copy latest Core & do the ZK Upgrade. Then copy module by module back. I guess on reactivating of Formicula there's no "folder availability" check. Thus cleaning cache spits the error.

Guess the upgrade function needs a small enhancement to include:

        // try to create the cache directory
        $this->createCacheDirectory();

And createCacheDirectory should return ok in case folder is alreardy available.

Guite commented 8 years ago

The upgrade method includes the whole install method already. Added a check for whether the directory already exists in https://github.com/zikula-ev/Formicula/commit/470ea2c90af142fd83a2509581049ca90fd7aa98