purplecat: Hand Drawn picture of a Toy Cat (Default)
purplecat ([personal profile] purplecat) wrote in [site community profile] dw_dev_training2012-08-11 05:55 pm

Metadata in Entry.pm

I'm trying to integrate setting a post as a sticky, and multiple stickies into the new entry form.

I've got the form set up to return whether the post should be a sticky and if so which sticky as a value for "sticky_select",

So in DW::Controller::Entry.pm in the function _decode, the value I want comes in as $post->{sticky_select}

That bit works fine.

But I then want to record the value in $req->{props} in order that it can be passed on to _do_post sensibly and the post set as the correct sticky at that point.

If I attempt to put in


$props->{sticky_select} = $post->{sticky_select};


or


$props->{"sticky_select"} = $post->{sticky_select};


or similar I get the error message

Client error: Unknown metadata: sticky_select

So my question is "How do I define metadata?" for use in this object.
fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)

[personal profile] fu 2012-08-23 11:32 am (UTC)(link)
I see what you mean to do now. When you get time, look into putting it into $req->{sticky_post} instead of $props->{sticky_post}.

$req == form request
$props == this entry's properties