Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

observe_locales around filter should yield even if globalize is disabled

#4

If the globalize?() method returns false and disables globalize, the rendering of the action is aborted with the log message:

Filter chain halted as [#] did_not_yield.

since observe_locales() returns without yielding (and Rails aborts the action).

A simple solution is to yield always:

Index: vendor/plugins/click-to-globalize/lib/click_to_globalize.rb

===================================================================

--- vendor/plugins/click-to-globalize/lib/click_to_globalize.rb (revision 810)

+++ vendor/plugins/click-to-globalize/lib/click_to_globalize.rb (working copy)

@@ -203,7 +203,10 @@

  1. request is processed.
  2. LocaleObserver catches all translations and pass them to the session.

def observe_locales

  • return unless globalize?
  • unless globalize?
  • yield
  • return
  • end

locale_observer = LocaleObserver.new

Locale.add_observer(locale_observer)

yield

Reported by Aitor Garay-Romero · August 4th, 2008 @ 11:22 PM

State: resolved
Milestone: Rails 2.1.x
Assigned to: Luca Guidi Luca Guidi

Activity

  1. Aitor Garay-Romero
    Aitor Garay-Romero

    Let's see if the formating is better...

    
    

    Index: vendor/plugins/click-to-globalize/lib/click_to_globalize.rb

    ===================================================================

    --- vendor/plugins/click-to-globalize/lib/click_to_globalize.rb (revision 810)

    +++ vendor/plugins/click-to-globalize/lib/click_to_globalize.rb (working copy)

    @@ -203,7 +203,10 @@

    1. request is processed.
    2. LocaleObserver catches all translations and pass them to the session.

    def observe_locales

    • return unless globalize?
    • unless globalize?
    • yield
    • return
    • end

    locale_observer = LocaleObserver.new

    Locale.add_observer(locale_observer)

    yield

    August 4th, 2008 @ 11:24 PM

  2. Aitor Garay-Romero
  3. Luca Guidi
    Luca Guidi
    • State changed from new to open
    • Tag set to bug, filter
    • Milestone set to Rails 2.1.x

    August 5th, 2008 @ 10:59 AM

  4. Luca Guidi
    Luca Guidi
    • State changed from open to resolved

    (from [e19f1c8aa9eb176afe6cbc3c14a02e8c001749c7]) Make sure observe_locales filter always yield the action even if #globalize? return false [#4 state:resolved]

    http://github.com/jodosha/click-...

    August 5th, 2008 @ 11:02 AM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.