Item8071: stand-alone html -> tml conversion broken
Priority: Normal
Current State: No Action Required
Released In:
Target Release:
From
TWikibug:Item6152:
I have a lot of very simple HTML to import.
tools/html2tml.pl script is advertised (
http://twiki.org/cgi-bin/view/TWiki/WysiwygPlugin) "Using the translators from perl scripts" as being capable of stand-alone html to tml conversion. I always get an error "Can't call method "getPreferencesValue" on an undefined value"
The built-in wysiwyg editor (4.2.3) works. So it's something about the stand-alone environment. I haven't done anything to/for/about the "WYSIWYGPLUGIN_STICKYBITS" variable that's in the traceback that I obtained.
This seems like a bug -- though perhaps the terse 1 line in the documentation is missing some setup requirements.
How, exactly, is one supposed to set things up for stand-alone conversions?
Example:
cd tools/
./html2tml.pl /temp/foo.htm
Can't call method "getPreferencesValue" on an undefined value at /var/www/servers/twiki/lib/TWiki/Func.pm line 474, <> chunk 1.
Here is a sufficient example with traceback. For the purposes of the example, the script is reading from stdin - I pasted the text with ^d after hitting 'c' in the debugger. The traceback is identical when run from a file. (And when run with a complete html page.)
cd tools/
perl -d ./html2tml.pl
Loading DB routines from perl5db.pl version 1.28
Editor support available.
Enter h or `h h' for help, or `man perldebug' for more help.
main::(./html2tml.pl:12): my $html2tml = new TWiki::Plugins::WysiwygPlugin::HTML2TML();
DB<1> c
<head>
<font face="Arial" size="6"><em>Redacted</em></font>
</head>
Redacted plain text <a href="foo_baz.htm">Albrecht</a> and
<a href="../dir/foo_bard.htm">Anna </a> text.
Can't call method "getPreferencesValue" on an undefined value at /var/www/servers/twiki/lib/TWiki/Func.pm line 474, <> chunk 1.
at /var/www/servers/twiki/lib/TWiki/Func.pm line 474
TWiki::Func::getPreferencesValue('WYSIWYGPLUGIN_STICKYBITS') called at /var/www/servers/twiki/lib/TWiki/Plugins/WysiwygPlugin.pm line 563
TWiki::Plugins::WysiwygPlugin::protectedByAttr('a', 'href') called at /var/www/servers/twiki/lib/TWiki/Plugins/WysiwygPlugin/HTML2TML/Node.pm line 564
TWiki::Plugins::WysiwygPlugin::HTML2TML::Node::_isProtectedByAttrs('TWiki::Plugins::WysiwygPlugin::HTML2TML::Node=HASH(0x9ccb34c)') called at /var/www/servers/twiki/lib/TWiki/Plugins/WysiwygPlugin/HTML2TML/Node.pm line 413
TWiki::Plugins::WysiwygPlugin::HTML2TML::Node::generate('TWiki::Plugins::WysiwygPlugin::HTML2TML::Node=HASH(0x9ccb34c)', 16) called at /var/www/servers/twiki/lib/TWiki/Plugins/WysiwygPlugin/HTML2TML/Node.pm line 486
TWiki::Plugins::WysiwygPlugin::HTML2TML::Node::_flatten('TWiki::Plugins::WysiwygPlugin::HTML2TML::Node=HASH(0x9c9aaf8)', 16) called at /var/www/servers/twiki/lib/TWiki/Plugins/WysiwygPlugin/HTML2TML/Node.pm line 460
TWiki::Plugins::WysiwygPlugin::HTML2TML::Node::generate('TWiki::Plugins::WysiwygPlugin::HTML2TML::Node=HASH(0x9c9aaf8)', 16) called at /var/www/servers/twiki/lib/TWiki/Plugins/WysiwygPlugin/HTML2TML/Node.pm line 227
TWiki::Plugins::WysiwygPlugin::HTML2TML::Node::rootGenerate('TWiki::Plugins::WysiwygPlugin::HTML2TML::Node=HASH(0x9c9aaf8)', 16) called at /var/www/servers/twiki/lib/TWiki/Plugins/WysiwygPlugin/HTML2TML.pm line 126
TWiki::Plugins::WysiwygPlugin::HTML2TML::convert('TWiki::Plugins::WysiwygPlugin::HTML2TML=HASH(0x9cda830)', '<head>\x{a}<font face="Arial" size="6"><em>Redacted</em></font><...', 'HASH(0x9af9f88)') called at ./html2tml.pl line 15
Debugged program terminated. Use q to quit or R to restart,
Installed plugins:
- X509UserPlugin (V1.0-3, $Rev: 15942 (11 Aug 2008) $): X509 Authentication support, used by TWiki Administrators
- SpreadSheetPlugin (any TWiki, $Rev: 17387 (11 Aug 2008) $): Add spreadsheet calculation like "$SUM( $ABOVE() )" to TWiki tables and other topic text
- CalendarPlugin (Dakar, $Rev: 0 (23 Sep 2008) $): Show a monthly calendar with highlighted events
- CommentPlugin (03 Aug 2008, $Rev: 17302 (11 Aug 2008) $): Allows users to quickly post comments to a page without an edit/preview/save cycle
- EditTablePlugin (4.8.4, $Rev: 17302 (11 Aug 2008) $): Edit TWiki tables using edit fields, date pickers and drop down boxes
- ImageGalleryPlugin (3.72, $Rev: 17034 (16 Jul 2008) $): Displays image gallery with auto-generated thumbnails from attachments
- ImgPlugin (Dakar, $Rev: 10608$): Allows TWiki variable-style insertion of images in topics
- InterwikiPlugin (03 Aug 2008, $Rev: 14913 (17 Sep 2007) $): Link ExternalSite:Page text to external sites based on aliases defined in a rules topic
- PreferencesPlugin (TWiki-4.2, $Rev: 15487 (11 Aug 2008) $): Allows editing of preferences using fields predefined in a form
- RenderListPlugin (2.0, $Rev: 16235 (11 Aug 2008) $): Render bullet lists in a variety of formats
- SlideShowPlugin (02 Aug 2008, $Rev: 17260 (11 Aug 2008) $): Create web based presentations based on topics with headings.
- SmiliesPlugin (Dakar, $Rev: 16049 (11 Aug 2008) $): Render smilies as icons, like for or for
- SubscribePlugin (Dakar, $Rev: 13787 (18 May 2007) $): Subscribe to web notification
- TablePlugin (1.034, $Rev: 17367 (11 Aug 2008) $): Control attributes of tables and sorting of table columns
- TinyMCEPlugin (03 Aug 2008, $Rev: 17302 (11 Aug 2008) $): Integration of TinyMCE? with WysiwygPlugin
- TwistyPlugin (1.4.10, $Rev: 15653 (19 Nov 2007) $): Twisty section JavaScript library to open/close content dynamically
- WysiwygPlugin (03 Aug 2008, $Rev: 17359 (11 Aug 2008) $): Translator framework for Wysiwyg editors
--
TimotheLitt - 16 Dec 2008
Confirm there's a problem with the convertor. The global session variable isn't set when getPreferencesValue is called.
--
CrawfordCurrie - 04 Mar 2009
Not a release blocker for 1.0.3
--
KennethLavrsen - 05 Mar 2009
This works now, in 1.1, so I'm changing the state to "no action required".
--
MichaelTempest - 30 Jul 2009
Replaced references to images on my server, which isn't accessible, with the corresponding images from foswiki.org. This will fix errors viewing page - and errors on my webserver.
--
TimotheLitt - 12 Jan 2010