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.
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.