Announcement

Symphony's issue tracker has been moved to Github.

Issues are displayed here for reference only and cannot be created or edited.

Browse

Closed#293: Still (like in issue #82): "Remove File" Doesn't Remove File

While overwriting files by files with the same name has been solved, still a simple “remove file, then save” action does not remove the file. (Tested in 2.0.7 and 2.0.8 RC1) This also means that replacing the file won’t work if you save in between.

Is this an intended behavior? (See issue #82.) I think that the file should be deleted from the server if “remove file” has been clicked.

Is it a bug? I find the following in the logs:

2010/04/03 19:35:37 > WARNING: 2 - unlink(/www/htdocs/v301321/www.example.com/workspace/uploads/) [<a href='function.unlink'>function.unlink</a>]: Is a directory in file /www/htdocs/v301321/www.example.com/symphony/lib/toolkit/class.general.php on line 657

@micheal-e - I’m guessing here, but /www/htdocs/v301321/www.example.com/workspace/uploads/ still has files in it, correct?

unlink() won’t work on a directory with files inside it - Symphony should probably throw an error here, or recursively delete the contents of the directory.

It shouldn’t be trying to delete a directory.

These lines of the upload field:

406: $existing_file = rtrim($rel_path, '/') . '/' . trim(basename($row['file']), '/');
409: General::deleteFile(WORKSPACE . $existing_file);

I’m guessing $row['file'] is empty. $existing_file ends up as workspace/uploads, and General::deleteFile() is blindly called.

I am not actively trying to delete a directory. As I said in my initial post, this happens when I try to delete a file (i.e. click on “remove file” and then save the entry). The file is not removed from the upload location, and the error in the log is just a by-product of this attempt.

This issue is closed.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details