[jifty-devel] Minor documentation note concerning PageRegion; example code causes error.

Joshua Pollack jp at MIT.EDU
Thu Feb 15 08:45:16 EST 2007

In Jifty::Manual::PageRegions, in the Examples section, code is given
for a fragment, to be used within a region, which is collapsible by
toggling $collapsed with a link.  The code shows how the calling
arguments are preserved by using the %ARGS hash.

/jifty/trunk/lib/Jifty/Manual/PageRegions.pod:r2791, line 186-194:

    % if ( $collapsed ) {
    <% Jifty->web->link(
        label   => _('text of the link'),
        onclick => {
            refresh_self => 1,
            args         => { %ARGS, collapsed => 0 },
    ) %>
    % } else {

However, it looks like when used as a fragment in a region, the
component's %ARGS contains the arguments of the parent component in
addition to those intended for the fragment.  Because these
(component) arguments will often contain an object, rendering the
region results in a nasty and confusing error:

WARN - Dumping circular structures is not supported with JSON::Syck at /opt/perl/lib/site_perl/5.8.8/Jifty/JSON.pm line 76.

What is intended is to only pass the arguments meant for that
fragment, passed in through its <%args> block.  I am doing this with
the unwieldy:

 %{(Jifty->web->get_region (Jifty->web->qualified_region))->arguments};

... but maybe there is a better way to phrase this in the documentation.


More information about the jifty-devel mailing list