Project

General

Profile

Actions

Defect #1281

closed

Unable to delete images in a wiki page

Added by Lane Roathe over 16 years ago. Updated over 16 years ago.

Status:
Closed
Priority:
Normal
Category:
Wiki
Target version:
-
Start date:
2008-05-21
Due date:
% Done:

100%

Estimated time:
Resolution:
Affected version:

Description

Whenever we try to delete an image from a wiki page we get the following error:

 TypeError in WikiController#destroy_attachment

can't modify frozen object

RAILS_ROOT: /var/www/rails_apps/redmine
Application Trace | Framework Trace | Full Trace

/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:213:in `[]'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:213:in `read_attribute'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:264:in `query_attribute'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:160:in `filename?'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:189:in `send'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:189:in `method_missing'
app/models/attachment.rb:71:in `after_destroy'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:322:in `send'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:322:in `callback'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:296:in `destroy_without_transactions'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:104:in `destroy'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in `transaction'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:80:in `transaction'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:100:in `transaction'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:104:in `destroy'
app/controllers/wiki_controller.rb:181:in `destroy_attachment'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1158:in `send'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1158:in `perform_action_without_filters'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `process'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/rails.rb:76:in `process'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/rails.rb:74:in `synchronize'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/rails.rb:74:in `process'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:159:in `process_client'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:158:in `each'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:158:in `process_client'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `run'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `initialize'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `new'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `run'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in `initialize'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in `new'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in `run'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:282:in `run'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:281:in `each'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:281:in `run'
/var/lib/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:128:in `run'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/command.rb:212:in `run'
/var/lib/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:281
/var/lib/gems/1.8/bin/mongrel_rails:16:in `load'
/var/lib/gems/1.8/bin/mongrel_rails:16

/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch'

/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:213:in `[]'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:213:in `read_attribute'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:264:in `query_attribute'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:160:in `filename?'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:189:in `send'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/attribute_methods.rb:189:in `method_missing'
app/models/attachment.rb:71:in `after_destroy'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:322:in `send'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:322:in `callback'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:296:in `destroy_without_transactions'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:104:in `destroy'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in `transaction'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:80:in `transaction'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:100:in `transaction'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:104:in `destroy'
app/controllers/wiki_controller.rb:181:in `destroy_attachment'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1158:in `send'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:1158:in `perform_action_without_filters'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:697:in `call_filters'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:689:in `perform_action_without_benchmark'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/rescue.rb:199:in `perform_action_without_caching'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:678:in `perform_action'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache'
/var/lib/gems/1.8/gems/activerecord-2.0.2/lib/active_record/query_cache.rb:8:in `cache'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/caching.rb:677:in `perform_action'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `send'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:524:in `process_without_filters'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/filters.rb:685:in `process_without_session_management_support'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/session_management.rb:123:in `process'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/base.rb:388:in `process'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:171:in `handle_request'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:in `dispatch'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in `dispatch_cgi'
/var/lib/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:in `dispatch'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/rails.rb:76:in `process'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/rails.rb:74:in `synchronize'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/rails.rb:74:in `process'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:159:in `process_client'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:158:in `each'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:158:in `process_client'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `run'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `initialize'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `new'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:285:in `run'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in `initialize'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in `new'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:268:in `run'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:282:in `run'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:281:in `each'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/configurator.rb:281:in `run'
/var/lib/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:128:in `run'
/var/lib/gems/1.8/gems/mongrel-1.1.4/lib/mongrel/command.rb:212:in `run'
/var/lib/gems/1.8/gems/mongrel-1.1.4/bin/mongrel_rails:281
/var/lib/gems/1.8/bin/mongrel_rails:16:in `load'
/var/lib/gems/1.8/bin/mongrel_rails:16

Request

Parameters:

{"attachment_id"=>"237",
 "id"=>"blackstone",
 "page"=>"Bscore"}

Show session dump

--- 
userslist_sort: 
  :order: asc
  :key: login
:page_layout: 
  left: []

  top: 
  - issuesassignedtome
  - calendar
  - timelog
  - documents
  right: 
  - issuesreportedbyme
boardsindex_sort: 
  :order: desc
  :key: messages.updated_on
projectslist_files_sort: 
  :order: asc
  :key: attachments.filename
:per_page: 100
:query: 
  :project_id: 3
  :filters: 
    status_id: 
      :values: 
      - "" 
      :operator: o
timelogdetails_sort: 
  :order: desc
  :key: hours
boardsshow_sort: 
  :order: desc
  :key: messages.updated_on
usersindex_sort: 
  :order: asc
  :key: login
adminprojects_sort: 
  :order: asc
  :key: name
issuesindex_sort: 
  :order: desc
  :key: issues.id
flash: !map:ActionController::Flash::FlashHash {}

Response

Headers:

{"cookie"=>[],
 "Cache-Control"=>"no-cache"}

I searched redmine and found no related issues, etc. on this topic. I did find via google that the "can't modify frozen object" could occur due to an operation on an object that has been modified/deleted/etc. Hopefully this helps.

We ran into this on 0.7, so I updated to 0.7.1 and then to the latest svn trunk without any change in behavior.


Files

unable_to_delete_attachements.dump.txt (10.5 KB) unable_to_delete_attachements.dump.txt Dump of r1444 failure on trying to delete attachment Lane Roathe, 2008-05-23 00:21
Actions

Also available in: Atom PDF