kayamaox / redmine-dmsf

Automatically exported from code.google.com/p/redmine-dmsf
0 stars 0 forks source link

Critical-dmsf crash when trying upload a file with empty title #119

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Click 'Add files' to add a file into the queue
2. Click 'Start Upload' ,then 'Uploaded Files' page shows up.
3. In 'Uploaded Files' page, clear title and then click 'commit'
4. Internal 500 Error happens
5. You will alwasy  experience same Internal Error when you try to launch 
    this project dmsf module afther that.

What is the expected output? What do you see instead?
1. DMSF shall deny this kind of commit with empty title by indicating user a 
error just like what it does when trying to create a folder with emty title.

What version of the DMSF and Redmine are you using? On what browser and
operating
system?
1. Broswer: chrome, IE8 & fireforx 5.0
2. OS: Windows 7 64bit

Please provide any additional information below.

Original issue reported on code.google.com by tim.lgs@gmail.com on 19 Jul 2011 at 4:59

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by vit.jo...@gmail.com on 20 Jul 2011 at 6:37

GoogleCodeExporter commented 8 years ago

Original comment by vit.jo...@gmail.com on 21 Jul 2011 at 6:09

GoogleCodeExporter commented 8 years ago
Hi Vit,
   I saw your issue update and update code to latest one. However this issue is still there,no improvement. when I tried to upload a file with empty title, redmine 500 error occurs and afterwards it always occurs if I access DMSF in the project. Log is same as attached before:

Processing DmsfController#show (for 192.168.1.100 at 2011-07-21 23:31:31) [GET]
  Parameters: {"folder_id"=>"7", "action"=>"show", "id"=>"testprj-1", "controller"=>"dmsf"}
Rendering template within layouts/base
Rendering dmsf/show

ActionView::TemplateError (undefined method `display_title' for nil:NilClass) 
on line #108 of vendor/plugins/redmine_dmsf/app/views/dmsf/show.html.erb:
105:            <td class="check"><%= check_box_tag("files[]", file.id, false, :title 
=> l(:title_check_for_zip_download_or_email)) %></td>
106:            <td class="title">
107:                <% file_download_url = url_for({:only_path => false, :controller => 
:dmsf_files, :action => "show", :id => file, :download => ""}) %>
108:                <%= link_to(h(file.last_revision.display_title),
109:                        file_download_url,
110:                        :class => "icon icon-file 
#{DmsfHelper.filetype_css(file.name)}",
111:                        :title => l(:title_title_version_version_download, :title => 
h(file.title), :version => file.version),

    vendor/plugins/redmine_dmsf/app/views/dmsf/show.html.erb:108
    vendor/plugins/redmine_dmsf/app/views/dmsf/show.html.erb:103
    vendor/plugins/redmine_dmsf/app/views/dmsf/show.html.erb:27
    config/initializers/mongrel_cluster_with_rails_211_fix.rb:62:in `dispatch_cgi'

Rendering D:/BitNami Redmine Stack/apps/redmine/public/500.html (500 Error)
rendering section "request"
rendering section "session"
rendering section "environment"
rendering section "backtrace"

Thanks,
Tim

Original comment by tim.lgs@gmail.com on 21 Jul 2011 at 3:41

GoogleCodeExporter commented 8 years ago
Hmm you have to manualy delete records from dmsf_files table that don't have 
corresponding records in dmsf_file_revisions table. That is the problem causing 
your error due to bogus upload with empty filename.

Original comment by vit.jo...@gmail.com on 21 Jul 2011 at 3:45

GoogleCodeExporter commented 8 years ago
Do you mean this is caused by bogus upload with empty filename I did before 
with old version DMSF?

Original comment by tim.lgs@gmail.com on 21 Jul 2011 at 3:51

GoogleCodeExporter commented 8 years ago
yep

Original comment by vit.jo...@gmail.com on 21 Jul 2011 at 3:53

GoogleCodeExporter commented 8 years ago
below is my test procedure for your reference:
1. Delete all dmsf data in DB by " rake db:migrate:plugin NAME=redmine_dmsf 
version=0 RAILS_ENV=production "
2. I can see all tables created by DMSF are deleted and there are not record in 
mysql database any more by runing 'mysql show tables' 
3. Check out latest DMSF code r206
4. Initialize/Update database by : rake db:migrate:plugins 
RAILS_ENV="production"
5. Log in Redmine, I can see a fresh state DMSF in my project.
6. Upload a file with empty title.
7. Unfortunately, 500 error occurs again and exactly same phenomena.

Original comment by tim.lgs@gmail.com on 21 Jul 2011 at 5:40

GoogleCodeExporter commented 8 years ago
I have also restarted redmine following sequence 4, thanks!

Original comment by tim.lgs@gmail.com on 21 Jul 2011 at 5:45

GoogleCodeExporter commented 8 years ago
You are right ... finaly found it and fixed

Original comment by vit.jo...@gmail.com on 21 Jul 2011 at 8:44

GoogleCodeExporter commented 8 years ago
Yep, r207 can fix this issue, thanks!

Original comment by tim.lgs@gmail.com on 22 Jul 2011 at 1:19

GoogleCodeExporter commented 8 years ago

Original comment by vit.jo...@gmail.com on 29 Aug 2011 at 9:10