Skip Menu |

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

Report information
The Basics
Id: 45960
Status: resolved
Worked: 10 min
Priority: 0/
Queue: HTML-WikiConverter

People
Owner: diberri [...] cpan.org
Requestors: mturner [...] cc.umanitoba.ca
Cc:
AdminCc:

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



Subject: html2wiki
Date: Mon, 11 May 2009 09:58:05 -0500
To: bug-HTML-WikiConverter [...] rt.cpan.org
From: Myron Turner <mturner [...] cc.umanitoba.ca>
I am the developer of DokuWikiFCK, and some of the users who have tried to use html2wiki reported an error which seems tied into the way in which html2wiki handles default options and pre-processes dialects. DokiWikiFCK has two default options specified in its attributes callback: sub attributes { return( browser => { default => 'IE5' }, group => { default => 'ANY' } ); } When users try to use html2wiki they get the following error: Can't use string ("ANY") as a HASH ref while "strict refs" in use at /usr/bin/html2wiki line 85. It doesn't seem to make any difference when the command specifies the options. Also, it will occur even with html2wiki --list Thanks, Myron Turner -- Show quoted text
_____________________ Myron Turner http://www.room535.org http://www.mturner.org http://net18reaching.org/cityscapes
_________________________________________________________ Searchable Database of Art and New Media News Feeds http://net18reaching.org/artrss
On Mon May 11 10:58:33 2009, mturner@cc.umanitoba.ca wrote: Show quoted text
> sub attributes { > return( > browser => { default => 'IE5' }, > group => { default => 'ANY' } > ); > }
The attributes() method is meant to return a hashref, not a hash. I accept responsibility for the confusion, though: while the docs specify that a hashref should be returned, it gives examples that return a hash instead. My bad. In any case, this can be fixed with: sub attributes { return { browser => { default => 'IE5' }, group => { default => 'ANY' } }; } Incidentally, attributes will someday be required to specify a type (boolean, string, etc.). You may as well incorporate this into your next release: use Params::Validate ':types'; sub attributes { return { browser => { default => 'IE5', type => SCALAR }, group => { default => 'ANY', type => SCALAR }, }; } Show quoted text
> When users try to use html2wiki they get the following error: > > Can't use string ("ANY") as a HASH ref while "strict refs" in use at > /usr/bin/html2wiki line 85.
This error is actually caused by the attributes() method not returning a hashref. Applying the above changes to H::WC::DokuWikiFCK should resolve this. Show quoted text
> It doesn't seem to make any difference when the command specifies the > options. Also, it will occur even with > html2wiki --list
Yes. It actually prevents html2wiki from working at all on any system where H::WC::DokuWikiFCK is installed. Bummer. Not your fault, of course. The documentation should have better explained this. I tried to post a quick annotation to the docs using annocpan, but alas, it is returning an internal server error when annotations are submitted. Also, I have patched html2wiki so that it will not blindly dereference attributes. This should prevent this error from happening again. Cheers, David Iberri
Subject: Re: [rt.cpan.org #45960] html2wiki
Date: Tue, 12 May 2009 21:55:13 -0500
To: bug-HTML-WikiConverter [...] rt.cpan.org
From: Myron Turner <mturner [...] cc.umanitoba.ca>
Thank you for the reply and for Wikiconverter. I've updated my module file and now all is well. Best wishes, Myron Turner David Iberri via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=45960 > > > On Mon May 11 10:58:33 2009, mturner@cc.umanitoba.ca wrote: >
>> sub attributes { >> return( >> browser => { default => 'IE5' }, >> group => { default => 'ANY' } >> ); >> } >>
> > The attributes() method is meant to return a hashref, not a hash. I > accept responsibility for the confusion, though: while the docs specify > that a hashref should be returned, it gives examples that return a hash > instead. My bad. In any case, this can be fixed with: > > sub attributes { > return { > browser => { default => 'IE5' }, > group => { default => 'ANY' } > }; > } > > Incidentally, attributes will someday be required to specify a type > (boolean, string, etc.). You may as well incorporate this into your next > release: > > use Params::Validate ':types'; > > sub attributes { > return { > browser => { default => 'IE5', type => SCALAR }, > group => { default => 'ANY', type => SCALAR }, > }; > } > >
>> When users try to use html2wiki they get the following error: >> >> Can't use string ("ANY") as a HASH ref while "strict refs" in use at >> /usr/bin/html2wiki line 85. >>
> > This error is actually caused by the attributes() method not returning a > hashref. Applying the above changes to H::WC::DokuWikiFCK should resolve > this. > >
>> It doesn't seem to make any difference when the command specifies the >> options. Also, it will occur even with >> html2wiki --list >>
> > Yes. It actually prevents html2wiki from working at all on any system > where H::WC::DokuWikiFCK is installed. Bummer. Not your fault, of > course. The documentation should have better explained this. > > I tried to post a quick annotation to the docs using annocpan, but alas, > it is returning an internal server error when annotations are submitted. > > Also, I have patched html2wiki so that it will not blindly dereference > attributes. This should prevent this error from happening again. > > Cheers, > David Iberri > > >
-- Show quoted text
_____________________ Myron Turner http://www.room535.org http://www.mturner.org http://net18reaching.org/cityscapes
_________________________________________________________ Searchable Database of Art and New Media News Feeds http://net18reaching.org/artrss
On Tue May 12 22:55:36 2009, mturner@cc.umanitoba.ca wrote: Show quoted text
> Thank you for the reply and for Wikiconverter. I've updated my module > file and now all is well.
Happy to help. Glad to hear it worked. Cheers, Dave