PiRSquared17 / activescaffold

Automatically exported from code.google.com/p/activescaffold
MIT License
0 stars 0 forks source link

issue with rails 1.2.6 ruby 1.8.7 and active scaffold 1.1.1 #692

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Load admin of site using activescaffold
2.
3.

What is the expected output? What do you see instead?
Admin forms, links, etc are expected.

Instead I see undefined method `[]' for
#<Enumerable::Enumerator:0x7febc61c3e28>

What version (or revision) of the product are you using?

activescaffold 1.1.1  (I think)
ruby 1.8.7
rails 1.2.6 (frozen)

If this bug causes an exception, please paste at least the first 20 lines
below.

/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/core_ext/stri
ng/access.rb:43:in
`first'
#{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/helpers/active_scaffold_helpers
.rb:41:in
`params_for'
#{RAILS_ROOT}/vendor/plugins/active_scaffold/frontends/default/views/_list_heade
r.rhtml:3:in
`_run_rhtml_47vendor47plugins47active_scaffold47frontends47default47views47_list
_header46rhtml'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_view/base.rb:325:in 
`send'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_view/base.rb:325:in 
`compile_and_render_template'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_view/base.rb:301:in 
`render_template'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_view/base.rb:260:in 
`render_file'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_view/base.rb:275:in 
`render_without_active_scaffold'
#{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/extensions/action_view.rb:45:in
`render'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_view/partials.rb:59:in
`render_partial_without_active_scaffold'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/benchmarking
.rb:26:in
`benchmark'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/benchmarking
.rb:26:in
`benchmark'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_view/partials.rb:58:in
`render_partial_without_active_scaffold'
#{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/extensions/action_view.rb:55:in
`render_partial'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_view/base.rb:287:in 
`render_without_active_scaffold'
#{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/extensions/action_view.rb:45:in
`render'
#{RAILS_ROOT}/vendor/plugins/active_scaffold/frontends/default/views/list.rhtml:
3:in
`_run_rhtml_47vendor47plugins47active_scaffold47frontends47default47views47list4
6rhtml'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_view/base.rb:325:in 
`send'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_view/base.rb:325:in 
`compile_and_render_template'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_view/base.rb:301:in 
`render_template'

Original issue reported on code.google.com by ci...@cswebconcepts.com on 25 Jun 2009 at 2:27

GoogleCodeExporter commented 9 years ago
Thanks for reporting this. If possible, could you try this with rails 2.3 and 
the
latest activescaffold we can at least see if it is fixed and go look for what 
fixed
it to backport said fix. Alternatively, if you could attach the model and 
controller
we might be able to see your issue.

Activescaffold is now hosted on github so make sure you grab that version. The 
1.1.1
from svn is over 2 years out of date.

Original comment by mr.ga...@gmail.com on 25 Jun 2009 at 4:28

GoogleCodeExporter commented 9 years ago
Hi.

This is running without a problem on the production server with 1.8.6. 
Unfortunately, when the staging server was created, ruby 1.8.7 was installed by
default.  I'm not in a position to upgrade the production server to rails 2.3 
at this
time.  But I might be able to test this for you on the staging server later 
today.

Your other suggestion was to send the model and controller.  

Here's the error - 

 Showing vendor/plugins/active_scaffold/frontends/default/views/_list_header.rhtml
where line #3 raised:

undefined method `[]' for #<Enumerable::Enumerator:0x7f6ecd0d6dd8>

Extracted source (around line #3):

1: <% if active_scaffold_config.action_links.any? { |link| link.type == :table 
} -%>
2:   <div class="actions">
3:     <% new_params = params_for(:action => :table) %>
4:     <% active_scaffold_config.action_links.each :table do |link| -%>
5:       <% next if controller.respond_to? link.security_method and
!controller.send(link.security_method) -%>
6:       <%= render_action_link(link, new_params) -%>

Sorry to be dense, but which model and controller and I sending to you?  Is it 
from
activescaffold or the from the app using it?

Thanks.

Original comment by ci...@cswebconcepts.com on 25 Jun 2009 at 5:17

GoogleCodeExporter commented 9 years ago
from the app

Original comment by mr.ga...@gmail.com on 25 Jun 2009 at 6:03

GoogleCodeExporter commented 9 years ago
I've attached one of the sections that's showing the errors.

Let me know if there's something else that's needed.

Thanks.

Original comment by ci...@cswebconcepts.com on 25 Jun 2009 at 7:45

Attachments:

GoogleCodeExporter commented 9 years ago
It's a compatibility problem between rails and ruby 1.8.7
In rails 2.2 chars was deprecated because a chars method was added to ruby 
1.8.7,
and it was renamed to mb_chars. The method 'first' is added by rails and it use
chars[1], and it fails in ruby 1.8.7. In rails 2.2 it uses mb_chars[1], so it 
works.

You can change @params_for[:controller].first(1) == '/' with
@params_for[:controller].chars.first == '/' in
#{RAILS_ROOT}/vendor/plugins/active_scaffold/lib/helpers/active_scaffold_helpers
.rb

Original comment by sergio.c...@gmail.com on 13 Jul 2009 at 10:43

GoogleCodeExporter commented 9 years ago
Thanks for your reply.  Will this need to be changed throughout active 
scaffold.  I'm
getting rjs errors from various spots including create.rjs

TypeError: $$("#admin__blog_posts-create--form a.cancel").first().link is 
undefined

Original comment by cschal...@gmail.com on 14 Jul 2009 at 3:28

GoogleCodeExporter commented 9 years ago
Probably it's another compatibility issue, between your ActiveScaffold version 
and
newest browser versions (Firefox 3 and Safari 3). Try with fixes from bug 553:
http://code.google.com/p/activescaffold/issues/detail?id=553

Original comment by sergio.c...@gmail.com on 16 Jul 2009 at 7:26

GoogleCodeExporter commented 9 years ago

Original comment by mr.ga...@gmail.com on 12 Aug 2009 at 7:11