Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 333900

Summary: Upload error
Product: z_Archived Reporter: Onno van der Straaten <onno.van.der.straaten>
Component: EPFAssignee: Onno van der Straaten <onno.van.der.straaten>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Onno van der Straaten CLA 2011-01-10 14:29:47 EST
See http://dev.eclipse.org/mhonarc/lists/epf-dev/msg03596.html
Comment 1 Onno van der Straaten CLA 2011-01-10 15:49:55 EST
Upload causes error undefined method `length' for #<Enumerable::Enumerator:0xb667a6a4>

    24:                     <td><%= link_to upload.filename, upload.url %></td>
    25:                     <td><%= upload.upload_type %></td>
    26:                     <td><%= upload.content_type %></td>
    27:                      <td><%= truncate(strip_tags(upload.description))%></td>
Comment 2 Onno van der Straaten CLA 2011-01-10 15:54:38 EST
Problem in truncate so this can by replacing by <td><%= strip_tags(upload.description)%></td>
Comment 3 Onno van der Straaten CLA 2011-01-10 16:20:52 EST
Seems to be a bug in Rails < 2.2 and Ruby 1.8.7.

The only way to fix (without upgrading Rails version) is to override the Rails truncate method. 

Workaround for now is to not use truncate there. 

So replace in uploads/_list.rhtml on line 27
<%= truncate(strip_tags(upload.description))%>
with
<%= strip_tags(upload.description) %> 

There might be other places where truncate is used and this could be a problem.
Comment 4 Onno van der Straaten CLA 2011-02-08 09:18:14 EST
Another example of this problem in link_to_comment.

http://dev.eclipse.org/mhonarc/lists/epf-dev/msg03635.html