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.
mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)

[staff profile] mark 2012-08-14 09:24 pm (UTC)(link)
Yup, this is it. Properties are defined in that file.

In this particular case, though, you probably don't want it to be a property on the entry. Right now, the sticky_select option is a userprop -- since the user has sticky entries. If you want the update page to toggle sticky entries, you probably want to have the post method set the userprop appropriately.

Do you have a bug reference for this so I can take a peek?