stephskardal / rails_admin_import

Rails Admin Import functionality
http://www.endpoint.com/
MIT License
160 stars 122 forks source link

stack level too deep with abstract_model call in views after a big CSV import #118

Open Quent1Pr opened 3 years ago

Quent1Pr commented 3 years ago

After importing a csv file with 900 lines and with success, rails_admin crashes everytime it tries to render a view with a path

Example with :

= form_tag import_path(@abstract_model), :multipart => true, class: 'form-horizontal denser' do

app/views/rails_admin/main/import.html.haml:15 SystemStackError in RailsAdmin::MainController#import stack level too deep

Or

- index_path = index_path(model_name: abstract_model.to_param)

rails_admin (2.1.1) app/views/rails_admin/main/dashboard.html.haml:12 SystemStackError in RailsAdmin::MainController#dashboard stack level too deep

actionpack (6.1.3.2) lib/action_dispatch/routing/mapper.rb:703:in `block (2 levels) in define_generate_prefix' is repeated several times in error stack

Any help would be appreciated. This library doesn't seem to modify abstract_model as it's a read-only attribute of ImportModel

Similar issue : https://stackoverflow.com/a/64054975

monkbroc commented 3 years ago

Hi,

I'm not likely to be able to reproduce that issue. If you manage to trace through the rails admin import code to figure out where the recursion is occurring please mange a PR and I'll release a new version.