Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 333900 - Upload error
Summary: Upload error
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EPF (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Onno van der Straaten CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-10 14:29 EST by Onno van der Straaten CLA
Modified: 2023-02-16 16:17 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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