When uploading description, the description is set to the contents field

Bug #178750 reported by JW
2
Affects Status Importance Assigned to Milestone
Chameleon (inactive)
Fix Released
Medium
JW

Bug Description

When uploading a description in the Admin Panel, the description won't be what was uploaded, instead it will be the contents of the entry.

Revision history for this message
JW (jw-00000) wrote :

This is caused by a bug in app/controllers/admin/entries_controller.rb. Lines 96-106:
    if entry_description and entry_description.size != 0
      path = "entries/" + @entry.id.to_s + ".description"
      if entry_description.content_type and
         !entry_description.content_type.split("/")[1].empty?
        path += "." + entry_description.content_type.split("/")[1].strip
      end
      File.open(RAILS_ROOT + "/public/" + path, "wb") do |file|
        file.write(entry_description.read())
      end
      @entry.contents = path
    end

Line 105 should be
      @entry.description = path

Revision history for this message
JW (jw-00000) wrote :

Fixed in branch unit-tests.

Changed in chameleon:
assignee: nobody → jw-00000
importance: Undecided → Medium
milestone: none → 0.6.2
status: New → Fix Committed
Revision history for this message
JW (jw-00000) wrote :

Fixed in trunk.

JW (jw-00000)
Changed in chameleon:
milestone: 0.6.2 → 0.6.1.2
JW (jw-00000)
Changed in chameleon:
milestone: 0.6.1.2 → 0.6.2
JW (jw-00000)
Changed in chameleon:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.