Skip Menu |
 

This queue is for tickets about the HTML-Tree CPAN distribution.

Report information
The Basics
Id: 35948
Status: resolved
Priority: 0/
Queue: HTML-Tree

People
Owner: Nobody in particular
Requestors: colin.fine [...] pace.co.uk
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 3.23
Fixed in: (no value)



Subject: Unhelpful message if I pass an arbitrary object in content.
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Type: text/plain
Charset: utf8
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 951
Download (untitled) / with headers
text/plain 951b
If I accidentally call push_content or equivalent with something that is an object but not an HTML::Element (for example I have a class which overrides "" and previously used the object in my HTML because it was in string context, but now pass it as an argument to push_content, where it is not in string context) I get the singularly unhelpful message Unsupported method starttag call in <myclass> Please can HTML::Element 1) test whether the object is right before calling starttag 2) confess, so that there is some hope of finding where the error is. I suggest altering 'traverse' to include the three lines marked with -> (after line 1590 in 3.23) $self->traverse( sub { ($node, $start) = @_; if(ref $node) { -> $node->isa('HTML::Element') or -> Carp::confess("Object of class ".ref($node). -> " cannot be processed by HTML::Element"); $tag = $node->{'_tag'};
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-24882-1284890109-593.35948-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 501
Download (untitled) / with headers
text/plain 501b
Hi, I made the following changes: if ( ref $node ) { # it's an element + + # detect bogus classes. RT #35948 + $node->isa( $self->element_class ) + or Carp::confess( "Object of class " + . ref($node) + . " cannot be processed by HTML::Element" ); $tag = $node->{'_tag'}; This should allow sub classing to function as expected. Cheers, Jeff.
MIME-Version: 1.0
In-Reply-To: <rt-3.8.HEAD-24882-1284890109-593.35948-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <rt-3.8.HEAD-24882-1284890109-593.35948-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-24889-1284979498-949.35948-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 318
Download (untitled) / with headers
text/plain 318b
On Sun Sep 19 05:55:09 2010, jfearn wrote: Show quoted text
> Hi, I made the following changes: >
Show quoted text
> > This should allow sub classing to function as expected. > > Cheers, Jeff.
Thanks. At this time depth, I have no idea what I was doing, and cannot hope to recreate the problem to test the fix, but that looks right. Colin Fine
MIME-Version: 1.0
Subject: 4.0 released
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-24885-1285123070-963.35948-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 96
Hi HTML::Tree ve4rsion 4.0 has been released which includes a fix for this issue. Cheers, Jeff.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.