Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If you look at http://drupal.org/node/331893#comment-1304174, currently anyway, both files uploaded there are linking to http://drupal.org/files/issues.
If I manually type in the URL http://drupal.org/files/issues/password-strength-meter-2.png it is there.
Comments
Comment #1
dwwI'm assuming this is a comment upload bug (until someone debugs this and can point definitively to a d.o configuration problem). This seems to be a new bug on d.o after the D6 upgrade. Giving this a slightly more precise title, since when looking at the previous title, I thought "that's by design".
Comment #2
hunmonk CreditAttribution: hunmonk commentedugh. it's not a bug in comment_upload i don't think, but probably in our rewrite code for files -> issues/files:
filepath should include the filename, not just files/issues/
Comment #3
hunmonk CreditAttribution: hunmonk commenteddigging further, this only seems to be happening occasionally:
Comment #4
hunmonk CreditAttribution: hunmonk commentedhere's the code that does the rewrite of the filepath in project_issue.module:
couple of things to note:
file_move()
workflow (as it's supposed to return the path the file was moved to), or some weirdness in the waybasename()
works.i'm inclined to think the issue is with the file_move() code, so moving to the appropriate queue.
Comment #5
toemaz CreditAttribution: toemaz commentedI confirm this bug on D6.10 & Project 6.x-1.x-dev & Project issue tracking 6.x-1.x-dev
I checked the db table and apparently, it does not occur all the time because only 2 out of 50 attached files had the missing file name, i.e. sites/mydomain.com/files/issues
I haven't looked into the code yet, nor did I try to reproduce it yet. To be continued.
Comment #6
toemaz CreditAttribution: toemaz commentedAlmost 3 years after date, I reproduced this consistently.
Upload a file using comment_upload to a project_issue node
AND
the project_directory_issues textfield on admin/project/project-issue-settings has a value like "issues"
Description of that textfield says in my case: "Subdirectory in the directory 'sites/mysite/files/' where attachments to issues will be stored."
AND
you choose to preview the comment
THEN
the file will be moved
When you then either hit submit or another preview
the resulting filepath in the files table will be: sites/mysite/files/issues/
The immediate solution:
Set project_directory_issues on admin/project/project-issue-settings to empty (no value) and save it.
Long term solution:
Change the code so the file move is not done when doing a preview.
Note:
In #3, one mentions that the problem occurs occasionally. Indeed, only when the submitter has previewed the comment with an uploaded file to it (and when project_directory_issues is not null obviously)
Hope this helps to crush this issue ;)
Comment #7
toemaz CreditAttribution: toemaz commentedThe call to change the path is done in project_issue_form_comment_validate:
So I assume we should add a conditional check there: only execute this when comment is actually being submitted, not when being previewed.
Comment #8
toemaz CreditAttribution: toemaz commentedAssigning it to the right project
This fixes it
Phew, after 3 years ;)