[Catalyst] Moose attributes not initializing when including
rippls at woodlandschools.org
Wed Jan 4 19:16:35 GMT 2012
On Wed, Jan 4, 2012 at 10:25 AM, Tomas Doran <bobtfish at bobtfish.net> wrote:
> This is because initialization or the slots in the instance will happen in
> a random order..
> So what's happening is that 'details' is being initialized (and so calling
> it's _build_details method) before '_temp_details' is initialized, which
> results in the temp_details accessor returning nothing when it's called (=
> _temp_details hasn't been initialized yet).
> You need to add a 'lazy =3D> 1' to the 'details' attribute, and all should
> be well...
> (If you _really_ want to ensure that the details attribute is built at
> construction time, then also add a BUILD method that just calls the
> accessor - ensuring the value gets built).
That fixed it! Thanks so much!
I'll set about re-factoring to try and stop passing the context object
about so freely! I have to say this was my first app using catalyst that
started a few years ago and has grown in a fairly haphazard way as I've
learnt more, and more has been demanded/asked for from the app by the end
users. Kudos to you guys for creating this awesome framework that has
allowed me to stumble along and already successfully rewrite major portions
of it without having to tear the entire thing down each time!
Woodland Public Schools
360 841 2730
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Catalyst