Categories > [old] TbsOoo & TinyDoc >

Delete bug in tbsooo_class.php?

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Guido
Date: 2005-11-07
Time: 09:47

Delete bug in tbsooo_class.php?

In TinyButStrong OpenOffice.org, my collegue Sandy (credit to him) saw something that caused directorys not to be removed and a warning to be thrown by php when GetPathnameDoc was called (some php installations have warnings showing up turned on by default). The cause is that RemoveDoc() now calls GetPathnameDoc() which calls RemoveTmpBasenameDir. After this, RemoveDoc deletes the file itself. This is of course the wrong order, it should first remove the document and then remove the folder which doesn't contain the document anymore.

I think the functions GetPathnameDoc() and RemoveDoc() in tbsooo_class.php should look like this:
  function GetPathnameDoc()
  {
    // return path
    return $this->_ooo_basename.'.'.$this->_ooo_file_ext;
  }
  function RemoveDoc()
  {
    // remove file
    unlink($this->GetPathnameDoc());
    // remove tmp dir
    $this->_RemoveTmpBasenameDir();
  }
By: Skrol29
Date: 2005-11-08
Time: 01:47

Re: Delete bug in tbsooo_class.php?

This post as been communicated to the tbsOOo developer.
By: Guido
Date: 2005-11-08
Time: 15:22

Re: Delete bug in tbsooo_class.php?

Ok thanks! I hope this suggestion will be usefull and adopted in the next tbsooo release.