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-22 10:41 am (UTC)(link)
This is going to be a bit -- what I was thinking was to still use the userprop (because we have a limited number of entries, and we'll want to be able to grab the list of all entries which are sticky entries on page load), instead of making it a property of the entry (because that would mean that we'd have to search through all the entries to find out which entries are sticky).

Alos, making it a userprop would make it easy to enforce / lookup if they've hit their limit of sticky entries.

Does that make sense?