milesj / uploader

[Deprecated] A CakePHP plugin for file uploading and validating.
MIT License
193 stars 73 forks source link

When deleting registry changes the default folder upload #126

Closed ghost closed 11 years ago

ghost commented 11 years ago

Hi Miles,

First, congratulations for the great work.

When deleting post that has no standard file folder 'uploads' is changed to 'uploads.Array'. Analyzing the code identified that last parameter of the method '_deleteFile:$path' when not informed because this fault line 642.

642: $file = new File($basePath . basename($path));

To fix the problem I added the following checks at the beginning of the method:

630: if (is_null($path)) return false;

My question is whether there was a need this fix or any parameters in $ actAs: Uploader.FileValidation or $ actAs: Uploader.Attachment could avoid this problem.

Note: I identified this situation records that do not have linked files. For records that have the plugin files works normally.

Best regards, Marcos

milesj commented 11 years ago

Fixed in 4.3.0.