[html-formfu] Beware of char cases

Carl Franks fireartist at gmail.com
Mon Oct 22 09:14:09 GMT 2007


On 22/10/2007, Daisuke Maki <daisuke at endeworks.jp> wrote:
> Hi,
>
> Just ran into a problem where upgrading from FormFu pre-1.00001 to
> 1.00005 resulted in previously working form would not render properly.
> Specifically, the fieldsets were placed in the totally wrong place e.g.
> forms that were previously rendering as
>
>  <form>
>    <fieldset>
>      <span>
>        <input>
>      </span>
>    </fieldset>
>    <fieldset>
>      <span>
>        <input>
>      </span>
>    </fieldset>
>  </form>
>
> Now rendered as
>
>  <form>
>    <fieldset>
>      <span>
>        <input>
>      </span>
>      <fieldset>
>      <span>
>        <input>
>      </span>
>    </fieldset>
>  </form>
>
> The root cause seems to be the renaming that happened for CPAN release.
> Namely, what used to be fieldset.pm now became Fieldset.pm -- and
> probably a simple search/replace caused the following code to fail:
>
>   sub _single_element {
>      ....
>      if (   $self->can('auto_fieldset')
>         && $self->auto_fieldset
>         && $new->type ne 'Fieldset' )
>      {
>
>      }
>   }
>
> $new->type contained 'fieldset', not 'Fieldset'.
>
> I suspect that there might be other places that something similar is
> happening, but for now I just committed r489 which fixes this by using a
> regular expression.
>
> let me know if this works out or not.

You should delete the old templates files, and re-create them again
using Catalyst::Helper::HTML::FormFu or HTML::FormFu::Deploy

In fact, you should do this when upgrading between any versions of HTML::FormFu.

(I'll make a point of adding a note to the Changes file of when the
templates change, so it's easier to see when upgrading the templates
is really necessary).

I'll be removing the case-sensitive check before the next cpan release.

Carl



More information about the HTML-FormFu mailing list