[html-formfu] Bug fix to HTML::FormFu::Model::DBIC delete_if_true
Nigel Metheringham
nigel.metheringham at dev.intechnology.co.uk
Fri Jun 5 12:09:26 GMT 2009
On 5 Jun 2009, at 08:59, Nigel Metheringham wrote:
> On 5 Jun 2009, at 03:03, Mike South wrote:
>>
>>> I think there is a very similar bug in delete_if_empty but that
>>> throws an exception in a way I haven't yet been able to trace.
>>
>> What exception do you get?
>
>
> The error thrown is
> DBIx::Class::Schema::__ANON__(): Can't find source for Date at
> [...]/lib/HTML/FormFu/Model/DBIC.pm line 132
OK, this one was down to Select (or rather _Group) type elements
calling into
code to pick up a resultset if model_config exists in the element
config. I
think this is probably less than ideal all things considered, but for
now have
added a "options_from_model: 0" into the model_config which prevents
this.
With that fixed, delete_if_empty also tries to delete DBIC rows that
are not
in the db at all (were newly created for this transaction). So I have
made the
DBIC delete method calls conditional on the row being ->in_storage,
which
makes this work as I want it....
Thats in change 1529:-
http://code.google.com/p/html-formfu/source/detail?r=1529
Nigel.
--
[ Nigel Metheringham Nigel.Metheringham at InTechnology.com ]
[ - Comments in this message are my own and not ITO opinion/policy - ]
More information about the HTML-FormFu
mailing list