I experienced this bug in both 4.7.0 and cvs version of project.module.. I don't know whether it's my fault or a real issue, but when adding a new release to a project I choose a tar.gz file to upload but the file is not transferred to the server: after pressung the "submit" button drupal doesn't report any error and everything seems to go right, but after reloading the page I get some warning about the filesize() function which tries to open a missing file (the tar.gz I just uploaded).

Sorry for my English and any eventual mistake in reporting the bug!

Maurizio

Comments

dmitrig01’s picture

I can confirm this.

moggy’s picture

There's no upload code!

There's just a note: "/* TODO: pending final fileapi" which has been there since I first looked this module 2 years ago.

Since this part of the module has no use on drupal.org. It's not likely to get done anytime soon. :(

dww’s picture

moggy: Since this part of the module has no use on drupal.org. It's not likely to get done anytime soon. :(

a) as the new project maintainer, one of the things i'm trying to do is make project useful for sites other than drupal.org again.

b) if you care about this issue and have the skills to debug this further and generate a patch that adds the missing functionality, i'll be more than happy to review, test, and apply the patch.

c) i can't promise i'll be able to work on this myself in the near future, since i'm doing all of this work as a volunteer, and i have other commitments in my life to deal with, too.

so, don't dispair, please help by writing the code that adds the functionality you need. i guarantee this issue will be resolved sooner if you do that than if you throw up your hands and wait for me or someone else to solve it. ;)

thanks!
-derek

moggy’s picture

I've looked at this several times since I started using drupal and have yet to work this bit out.

don't worry, if I work it out I'll post a patch.

dww’s picture

great, thanks! wish i could help more in the short term on this one...

mauriziopinotti’s picture

ok, I've done some work on this.. I've managed to really upload the file, now I'm gonna move it to a proper location and ensure that all is working properly.. I'll tell you something more (and post a patch) in the next days :D

mauriziopinotti’s picture

Assigned: Unassigned » mauriziopinotti
Status: Active » Needs review
StatusFileSize
new11.25 KB

Wow, my first patch for Drupal, hope this helps!

Changes
--------

* releases get really uploaded!
* releases are stored in the "files/project_releases" subdirectory or any other specified in the settings
* releases can be downloaded with both private and public urls

Wishlist
-------

* delete/edit releases

dww’s picture

Status: Needs review » Needs work

can you attach your changes as a patch, as described at http://drupal.org/patch ? that'll make it a lot easier for me (and others) to review.

thanks!
-derek

mauriziopinotti’s picture

Version: 4.7.x-1.x-dev » x.y.z
StatusFileSize
new3.47 KB

ok, I'm sorry.. can you check now?
This is the first time I use diff and cvs so there can be lots of mistakes :p

Andrupal’s picture

I tried the patch and all "chunks" succeeded except #1 and #2

#1 failed at 1
#2 failed at 117

mauriziopinotti’s picture

uhm.. I've created the patch this way:

1) downloaded and unpacked project-cvs.tar.gz
2) copied "project" folder into "project.orig"
3) edited "project/release.inc" and "project/project.inc"
4) diff -urNF^function project.orig project > project.patch

is it right?

mauriziopinotti’s picture

no suggestions? :|

moggy’s picture

StatusFileSize
new5.47 KB

try this one.

I used the previous patch as a guide. I've used more drupal api's and editing works.

re project releases directory, if we want to upload to there we've got a big problem. Project has been written around the assumption that if the releases directory is set we're not going to be manually uploading files. To undo this would be a LOT of work.

moggy’s picture

Status: Needs work » Needs review

sorry, forgot to change status.

AjK’s picture

StatusFileSize
new6.12 KB

Tried the patch and 1 out of six hunks failed. It seems a mod has been made in the CVS version that conflicts with code in that hunk (2).

I've attached a patch that, I believe, fixes hunk 2 failure.

It all seems to work except for "delete" which "blank screens". Nothing appears in the error_log and it appears the file isn't deleted. It's 1:50am here for me so to tired to look futher but I will if I get a moment over the weekend.

regards
--AjK

dww’s picture

Status: Needs review » Needs work

sorry, this won't do:

+  // TODO: read dir name from settings, actually doesn't work
+  //(Project would need a lot of work if this part was to use the project_release_directory)
+  //(Just hardcode it for now)
+  //$releases_dir = $files_dir.'/'.variable_get('project_release_directory', 'project_releases');
+  $releases_dir = $files_dir.'/project_releases'; 

someone has to figure that out before this can be committed.

also, i don't personally care *that* much, but this isn't proper coding style:

+      } else { 

should be:

+      }
+      else { 

a quick skim of the patch didn't reveal any other major problems, but i haven't had a chance to test this yet.
if someone posts a new patch that addresses the first of these concerns (the variable_get('project_release_directory' ...) stuff), i'll do a more thorough review and test it out locally.

thanks again for everyone's help trying to get this working!
-derek

hperantunes’s picture

I tried last patch sent by AjK, and it didn't worked for me.

In fact, the module stopped even the "false upload" in which only an entry for the release on table "project_releases" were created (thus, searching the "uploaded" release file in drupal root directory).

Somebody have a hint on how to change just the directory where the module searches the "uploaded" file? I intended manually upload releases to files/projects_releases/ directory instead root.

hperantunes’s picture

I've did an über hard code to send to the database a custom path to the release file on insertion and update of a release.

For some reason, if there's any value in variable.project_release_directory on the database, the link to "upload" a release in project summary does not shows itself. So, I add the complete path in project_releases.path.

In the file release.inc source file, find the project_release_save function. Add after this line:

$node = node_load($release->nid);

... the code that follows:

$release->path = 'files/projects_releases/' . $release->path;

The path "files/projects_releases/" is just an example.

dww’s picture

Version: x.y.z » 4.7.x-1.x-dev
Status: Needs work » Closed (won't fix)

this is now totally fixed and happy if you use the 4.7.x-2.0 version of project.module, where releases are now represented as real nodes (using the new project_release.module). i'm not going to fix this in 4.7.x-1.*, since it's already massively better in the 4.7.x-2.* series.

thanks for all the help, anyway!
-derek