Recently in bugs Category

Yesterday, a co-worker had some growing pains when updating a Rails 1.2.3 application to Rails 2.1. I gladly came to the rescue (he actually saved me from a boring job) and we analyzed together what was the error we were getting on the app.


The thing happened to be on the form_helper method
datetime_select



A chunk of code (just like the one above) was throwing an exception that said:


ArgumentError: wrong number of arguments (1 for 2)


The exception was getting threw inside a method called
date_or_time_select
that was being invoked; inside the
datetime_select
method.

We checked out the plugins that could overwrite this method, and
attr_locked
was doing it via
alias_method_chain
. The problem was that, this overwrite didn't provide the correct number of parameters for the Rails 2.1 version (the Rails 2.1 version of
datetime_select
accepts an extra hash parameter called html_options). We made some little changes to the current implementation and it worked as expected.

Hope you can get some benefits from this patch

Recently I'm testing in Firefox 3 the "admin" section - implemented using ActiveScaffold - of a Rails application we made.

I'm getting RJS Errors when trying to update a record:
  • TypeError: $$("#admin__operator_details-update-151-form a.cancel").first().link is undefined
  • $$("#admin__operator_details-update-151-form a.cancel").first().link.close_with_refresh();

The issues is already reported as #553

The summary is that the problem lies within the deprecated getElementsByClassName function in the active_scaffold.js.

To fix (thanks to Eric Bjorkvall) just replace in files:

  • /public/javascripts/active_scaffold/default/active_scaffold.js
  • /vendor/plugins/active_scaffold/frontends/default/javascripts/active_scaffold.js
the line: with:

Instead of replacing the original assets of ActiveScaffold I skipped the change on /vendor/plugins/active_scaffold/frontends/default/javascripts/active_scaffold.js and just comment the /vendor/plugins/active_scaffold/init.rb in order to avoid the copy assets on plugin initialization.

About this Archive

This page is a archive of recent entries in the bugs category.

programming is the next category.

Find recent content on the main index or look in the archives to find all content.