PDA

View Full Version : file final version cannot delete


jtpolk
05-01-06, 04:37 PM
I was testing out the versioning of files and I set a file version to final - disallowing any further checkout.

When I did that, I could still see the file(s), but I lost the edit icon and check out icons - all fine and well, but that meant that I also lost the ability to delete the file.

When I went to the database, I noticed that the word "final" was in the file_checkout column of the files table in the database.

When I removed the word final, then the edit icons re-appeared and I had access to the edit icon where I could go in and edit the file - in this case, deleting the file(s) - going through the versions.

I've not worked with it more, but the file was not attached to any project - it was under "all".

Is there another way to delete a "final" version of a file other than directly accessing the database and then removing the "final" word? Does this behavior change when it is associated with a project?

I can easily imagine some team member labeling a file as final, but then the client of a project changes their mind and the file will not be used, or someone prematurely labeling a file "final" and then there being a need to "unfinal" the final stamp.

thanks....
Jim Tom Polk

pedroa
06-01-06, 12:54 AM
Line 182 of modules/files/index_table.php:

<?php if ($canEdit && ( empty($latest_file['file_checkout']) || ( $latest_file['file_checkout'] == 'final' && ($canAdmin || $latest_file['project_owner'] == $AppUI->user_id) ))) {


This says that if you are able to edit files, and your an administrator user or you are the project owner, then you will be able to see the edit icon for a final file anyway.
So test that out.

On the other hand line 44 of modules/files/addedit.php:

if ($obj->file_checkout == 'final' && ! $canAdmin) {

(this one is extra protection for wise guys)

If you try to edit a file that is final version and you are not an administrator you are sent to a access denied page.

Pedro A.

leonard
13-02-06, 08:32 PM
I still can't delete my final file. I don't know whether it is because I deleted everything else (companies, projects, tasks).

I'm loggin in as admin and I've set the "Edit previous versions" to "on".

josuu
15-02-06, 01:05 AM
I still can't delete my final file. I don't know whether it is because I deleted everything else (companies, projects, tasks).

I'm loggin in as admin and I've set the "Edit previous versions" to "on".

Maybe it has something to do with
http://www.dotproject.net/mantis/bug_view_page.php?bug_id=0001489 ?

leonard
15-02-06, 03:51 PM
I don't think so as there is no PHP error in my log. I've already put error_reporting to E_ALL.

But it is weird that I can't find the piece of code in the mantis. My index_table.php version is:

/* FILES $Id: index_table.php,v 1.55 2005/04/08 16:32:10 gregorerhardt Exp $ */

while in the mantis it is:

/* FILES $Id: index_table.php,v 1.55.4.4 2005/12/05 00:30:13 pedroix Exp $ */

I downloaded dP version 2.0.1. Is there a stable newer version?

Karen
15-02-06, 05:05 PM
I downloaded dP version 2.0.1. Is there a stable newer version?

Not as a packaged release but you can grab it from the CVS or you can get a nightly snapshot from:

http://dotproject.sourceforge.net/dotproject-stable_2.tar.bz2

If you go to the CVS make sure you're getting stable_2 - HEAD is our dev branch and is guaranteed to be unstable.

josuu
15-02-06, 06:56 PM
I don't think so as there is no PHP error in my log. I've already put error_reporting to E_ALL.

But it is weird that I can't find the piece of code in the mantis. My index_table.php version is:

/* FILES $Id: index_table.php,v 1.55 2005/04/08 16:32:10 gregorerhardt Exp $ */

while in the mantis it is:

/* FILES $Id: index_table.php,v 1.55.4.4 2005/12/05 00:30:13 pedroix Exp $ */

I downloaded dP version 2.0.1. Is there a stable newer version?

There was some problems in files module (for example: http://www.dotproject.net/vbulletin/showthread.php?t=4422&highlight=edit+file) in version 2.0.1 so some changes to it were made.
Update your files module from the stable_2 branch CVS and then check if problem is still exist.