osdir.com
mailing list archive F.A.Q. -since 2001!



Subject: BUGFIX: t/forward.t - problem with
HTML::FillInForm >= 1.07 - msg#00040

List: lang.perl.modules.cgi-appplication

Mail Archive Navigation:
by Date: Prev Next Date Index by Thread: Prev Next Thread Index

"make test" on CGI::Application::Plugin::ValidatorRM was failing on
t/forward.t.
t/forward........NOK 2
# Failed test 'form is returned'
# in t/forward.t at line 22.
# got: 'legacy form output HUH'
# expected: 'legacy form output'
t/forward........NOK 4
# Failed test 'form is returned'
# in t/forward.t at line 56.
# got: 'forward form output
HUH' # expected: 'forward form
output'
# Looks like you failed 2 tests of 4.
t/forward........dubious
Test returned status 2 (wstat 512, 0x200)
DIED. FAILED tests 2, 4
Failed 2/4 tests, 50.00% okay

I searched, and found an existing recent problem report with the
same error, but no fix:

http://www.mail-archive.com/cgiapp@xxxxxxxxxxxxxxxxx/msg06154.html
Subject: Re: Problem installing the CGI::Application::Pliugin::Session and
ValidateRM


The problem is that the t/forward.t test has a workaround in it for a bug
in HTML::FillInForm <= 1.06. The FillInForm bug can be seen with the
following:

use HTML::FillInForm;
my $src ="one two three";
my $res = HTML::FillInForm->new->fill( scalarref => \$src );
print "[$src][$res]\n";

Which results in "[one two three][one two]" under FillInForm 1.06.
This doesn't normally cause a problem, because templates and files generally
end in a newline character, which will get chomped, but won't be missed
by anyone.


FillInForm >= 1.07 fixed this by changing the last part of sub fill to
include "$self->eof;":
# diff -c HTML-FillInForm-1.0[67]/lib/HTML/FillInForm.pm
*** 89,94 ****
--- 95,102 ----
$self->parse($_);
}
}
+
+ $self->eof;
return delete $self->{output};
}



Here's a patch for t/forward.t to make it compatable with both the old
and new HTML::FillInForm.
------BEGIN PATCH------
--- t/forward.t 2007-09-23 04:40:13.000000000 -0400
+++ t/forward_new.t 2007-09-23 04:55:26.000000000 -0400
@@ -12,7 +12,8 @@
sub legacy_form { my $self = shift;
Test::More::is($self->get_current_runmode, 'legacy_process', "if
::Forward is not loaded, current_rm is not updated");
- $self->header_type('none'); return "legacy form output HUH"; }
+ $self->header_type('none');
+ return ($HTML::FillInForm::VERSION <= 1.06) ? "legacy form output
HUH" : "legacy form output"; }

sub legacy_process { my $self = shift; my ($results, $err_page) =
$self->check_rm('legacy_form', { required => 'fail' }); return
@@ -42,7 +43,7 @@
Test::More::is($self->get_current_runmode, 'forward_form',
"if ::Forward is loaded, current_rm is updated");
$self->header_type('none');
- return "forward form output HUH";
+ return ($HTML::FillInForm::VERSION <= 1.06) ? "forward form output
HUH" : "forward form output";
}

sub forward_process {
------END PATCH------

Thanks,
--
Josh I.

Thread at a glance:

Previous Message by Date:

Re: prerun and errormode handling

Hello James, > just curious. why are you using the Dev version of CGI-Application-4.07_01? > it doesn't seem to > have any advantages to me. Sorry for the confusion but we aren't using the development release. We are using 4.06. I didn't want to go through the work of writing a patch for 4.06 if there weren't any plans for another release or writing a patch for 4.06 and forcing someone else to port the change forward. I guess I was asking more about the release plans for cgiapp 4.07 vs 4.06 but not in a very clear way. :) > regarding trapping errors, usually the failures from cgiapp_prerun/setup are > unexpected system > errors. I let apache handle that (use ErrorDocument) As for 'setup' errors, I agree that they would be better handled by something else. But I have some items that seem to make sense to validate inside of cgiapp_prerun method. My understanding with ErrorDocument is that it doesn't pass any real message to your page. (for example: if database connection is down call dba's vs. filesystem is missing call sysadmins, it just calls a page for 500's or such.). Thinking a bit more about it, I guess I could do something like: sub cgiapp_prerun { my $self = shift; eval { $self->validate_env(); }; my $err = $@; if ( $err) { $self->param('error_msg', $err ); $self->prerun_mode( 'error' ); } } but this seems a bit wrong. Take Care, Lee --------------------------------------------------------------------- Web Archive: http://www.mail-archive.com/cgiapp@xxxxxxxxxxxxxxxxx/ http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2 To unsubscribe, e-mail: cgiapp-unsubscribe@xxxxxxxxxxxxxxxxx For additional commands, e-mail: cgiapp-help@xxxxxxxxxxxxxxxxx

Next Message by Date:

[ANNOUNCE] Krang V2.20

Krang v2.20 is now available (the source release is up now and binary builds should be up soon). Notable changes in this release: * Lots and lots of bug fixes * Implemented desk security as specified in docs/permissions.pod * Added --below_category_id option and implemented --limited_to_category option for bin/krang_publish * Added Fedora 7, Redhat Adaptive Server AS3 and AS4 as a platforms for building * Added new module Krang::URL. It provides one method, real_url() which adjusts the URL of story, media and category objects according to their publishing context. * Added krang_src_dependency_check script to check Perl source module dependencies * Permit krang_export to handle large sites without running out of ram * Added "ApacheMaxSize" directive to krang.conf so that you can adjust the memory used depending on the machine capabilities and the number of addons installed Detailed change-log here: http://krang.sf.net/docs/changelog.html Krang is an Open Source web-publisher / content-management system designed for large-scale magazine-style websites. It is a 100% Perl application using Apache/mod_perl and MySQL, as well as numerous CPAN modules. Krang provides a powerful and easy to use story and media editing environment for website editors, as well as a complete template development environment for web designers. On the back-end, Perl programmers can customize Krang to control the data entered in the story editor and add code to drive the templates to build output. Krang can be enhanced with add-ons containing new skins and other new features. Krang easily handles large data sets and can manage multiple websites in a single installation. For more information about Krang, visit the Krang website: http://krang.sourceforge.net/ There you can download Krang, view screenshots, read documentation, join our mailing-lists and access the CVS tree. - the Krang team --------------------------------------------------------------------- Web Archive: http://www.mail-archive.com/cgiapp@xxxxxxxxxxxxxxxxx/ http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2 To unsubscribe, e-mail: cgiapp-unsubscribe@xxxxxxxxxxxxxxxxx For additional commands, e-mail: cgiapp-help@xxxxxxxxxxxxxxxxx

Previous Message by Thread:

prerun and errormode handling

Hello Everyone, I need to capture exceptions caused in the cgiapp_prerun sub. In my situation, I want to verify a set of environmental parts that are used in many run modes. So instead of verifying these each time, I would like to do it in the prerun and then output a nice universal error page (one used for other errors). Taking the advice from a previous discussion: http://www.nabble.com/error-mode-question-tf2025600.html#a5580234, I took the time to add test cases and write a patch but I did so on CGI-Application-4.07_01 source. There are two problems with 4.07: it is much slower than 4.06 and has a large set of dependencies. These leads to a couple of questions: 1. Should I be adding this update to 4.06 or the 4.07 line? At this point, I can't see installing the 4.07 line with the performance hit (since we run most of these as pure CGIs and converting them isn't really a possibility, for business reasons.). I am willing to produce patches and tests for both. 2. In my case, I only need error handling during prerun but while I'm working on this, it wouldn't take much more work to update the handling for the postrun hook. I could do this if anyone is interested. Thoughts, Comments, suggestions? Thanks for your time, Lee --------------------------------------------------------------------- Web Archive: http://www.mail-archive.com/cgiapp@xxxxxxxxxxxxxxxxx/ http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2 To unsubscribe, e-mail: cgiapp-unsubscribe@xxxxxxxxxxxxxxxxx For additional commands, e-mail: cgiapp-help@xxxxxxxxxxxxxxxxx

Next Message by Thread:

[ANNOUNCE] Krang V2.20

Krang v2.20 is now available (the source release is up now and binary builds should be up soon). Notable changes in this release: * Lots and lots of bug fixes * Implemented desk security as specified in docs/permissions.pod * Added --below_category_id option and implemented --limited_to_category option for bin/krang_publish * Added Fedora 7, Redhat Adaptive Server AS3 and AS4 as a platforms for building * Added new module Krang::URL. It provides one method, real_url() which adjusts the URL of story, media and category objects according to their publishing context. * Added krang_src_dependency_check script to check Perl source module dependencies * Permit krang_export to handle large sites without running out of ram * Added "ApacheMaxSize" directive to krang.conf so that you can adjust the memory used depending on the machine capabilities and the number of addons installed Detailed change-log here: http://krang.sf.net/docs/changelog.html Krang is an Open Source web-publisher / content-management system designed for large-scale magazine-style websites. It is a 100% Perl application using Apache/mod_perl and MySQL, as well as numerous CPAN modules. Krang provides a powerful and easy to use story and media editing environment for website editors, as well as a complete template development environment for web designers. On the back-end, Perl programmers can customize Krang to control the data entered in the story editor and add code to drive the templates to build output. Krang can be enhanced with add-ons containing new skins and other new features. Krang easily handles large data sets and can manage multiple websites in a single installation. For more information about Krang, visit the Krang website: http://krang.sourceforge.net/ There you can download Krang, view screenshots, read documentation, join our mailing-lists and access the CVS tree. - the Krang team --------------------------------------------------------------------- Web Archive: http://www.mail-archive.com/cgiapp@xxxxxxxxxxxxxxxxx/ http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2 To unsubscribe, e-mail: cgiapp-unsubscribe@xxxxxxxxxxxxxxxxx For additional commands, e-mail: cgiapp-help@xxxxxxxxxxxxxxxxx
blog comments powered by Disqus

Home | News | Sitemap | FAQ | advertise | OSDir is an Inevitable website. GBiz is too!