[Catalyst] Bustage between HTML::Prototype 1.35 and 1.36 ?

Kevin Old kevinold at gmail.com
Tue Dec 13 05:23:41 CET 2005


On 12/12/05, Allen S. Rout <asr at ufl.edu> wrote:
>
> Moving a cat app between my workstation and the oncoming app box, I've
> encountered an odd error in one of my Prototype invocations.  I was wondering
> if anyone else had seen the like.  Distilled down, I can evoke the changed
> behavior with
>
> #!/usr/bin/perl
> use HTML::Prototype;
> my $p = new HTML::Prototype;
>
> print $p->link_to_remote('title',{
>   update => 'a_node' ,
>   url    => '/some.html'});
>
>
> On 1.35, I get
>
> <a href="#" onclick=" new Ajax.Updater( 'a_node',  '/some.html',
> { asynchronous: 1 } ) ; return false">title</a>
>
> which works.    On 1.36 I get
>
> <a href="/some.html" onclick=" new Ajax.Updater( &#39;a_node&#39;,
> &#39;/some.html&#39;, { asynchronous: 1 } ) ; return false">title</a>
>
>
> which does not.  I've been rooting around in the HTML::Prototype code to see
> what's changed, but the short answer is 'a helluva lot'. :)  Anyone else see
> this, or have any brainstorms about what might have decided to encode the
> quotes?

Hi Allen,

I'm running HTML::Prototype 1.36 and with this script:

#!/usr/bin/perl

use warnings;
use strict;
#Written by Kevin at Mon 12 Dec 2005 10:44:33 PM EST

use HTML::Prototype;

my $p = new HTML::Prototype;

print $p->link_to_remote('title',{
 update => 'a_node' ,
  url    => '/some.html'});

I get this result:

<a href="/some.html" onclick=" new Ajax.Updater( 'a_node', 
'/some.html', { asynchronous: 1 } ) ; return false">title</a>

I'm not sure if it's the upgrade with HTML::Prototype that did it. 
Here are a few suggestions:

1) Do a "locate Prototype.pm".  You should see something like below:

[kevin at localhost ~]$ locate Prototype.pm
/usr/lib/perl5/site_perl/5.8.6/Catalyst/Helper/Prototype.pm
/usr/lib/perl5/site_perl/5.8.6/Catalyst/Plugin/Prototype.pm
/usr/lib/perl5/site_perl/5.8.6/HTML/Prototype.pm

If there are more lines, you might have conflicting versions of HTML::Prototype.

2) It's very possible that the HTML escaping is being done by your
View (I'm assuming you're using Catalyst since you posted this here). 
If you're using Mason, check to make sure you don't have a <%filter>
that's overriding the result.

If you can, post more information about your setup and how you're
using the code.

Hope this helps,
Kevin
--
Kevin Old
kevinold at gmail.com



More information about the Catalyst mailing list