Mailing List Archive

update_from_pod breakage
Not 100% sure how this is supposed to work, but it's been dying for me,
if I give it pod like:

=begin foo


=bar

This is a bar field

=end foo

The extra new line between the "=begin foo" and "=bar" cause it to die.
I believe the following patch fixes it. Still passes make devtest,
and I guess we need to add more tests for stuff like this.


--- lib/Bric/Biz/Element/Container.pm (revision 8506)
+++ lib/Bric/Biz/Element/Container.pm (working copy)
@@ -2611,6 +2611,12 @@
else {
$kn = $def_field;
$field_type = $field_types{$kn};
+
+ # we weren't expecting this default field *here*,
+ # so just ignore it
+ if (not defined $field_type) {
+ next POD;
+ }
my $field_occurrence =
$self->get_field_occurrence($field_type->get_key_name);
my $max_occur = $field_type->get_max_occurrence;
if (defined $field_type && $field_ord{$kn} &&
$max_occur && $field_occurrence > $max_occur) {
@@ -2637,12 +2643,6 @@
last DEF_FIELD if $line =~ /^\s*$/;
($content .= "$line\n") =~ s/^$indent//mg;
}
-
- # we weren't expecting this default field *here*,
- # so just ignore it
- if (not defined $field_type) {
- next POD;
- }
}

# Fix up the content.
Re: update_from_pod breakage [ In reply to ]
On Mar 17, 2009, at 1:53 PM, Adrian Yee wrote:

> Not 100% sure how this is supposed to work, but it's been dying for
> me, if I give it pod like:
>
> =begin foo
>
>
> =bar
>
> This is a bar field
>
> =end foo
>
> The extra new line between the "=begin foo" and "=bar" cause it to
> die. I believe the following patch fixes it. Still passes make
> devtest, and I guess we need to add more tests for stuff like this.

Seems reasonable. Can you add a regression test for it that fails,
then apply the patch to fix the test, then commit it?

This should probably go into rev_1_10…

Thanks!

David