Item11489: SEARCH using META:WORKFLOWHISTORY is not working

pencil
Priority: Normal
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: WorkflowPlugin
Branches: trunk
Reported By: GilmarSantosJr
Waiting For:
Last Change By: PaulHarvey
The following query should return the set of topics that have at least one rev where it was APPROVED, but it returns nothing.

%SEARCH{"form.name ~ '*ProcedureForm' AND META:WORKFLOWHISTORY[state = 'APROVADO']"
   order="date" nonoise="on" type="query"
   header="| *Título* |"
   format="| [[$topic][$formfield(Titulo)]] |"
}%

WORKFLOWHISTORY is a multi-valued meta key, so it's not parsed without a call to registerMeta.

-- GilmarSantosJr - 31 Jan 2012

Hi Gilmar,

I've never used this plugin, but I just thought I'd point out - it helps enormously to register the full schema with registerMETA(), if at all possible, for the sake of alternate/caching backends like SolrPlugin, DBIStoreContrib & MongoDBPlugin.

I know things like RevCommentPlugin are doomed (it is not possible to enumerate all the possible key names, because they keep incrementing ad infinitum), but if it is possible to register all possible keys which are expected be stored in a particular META:TYPE, it makes the job of DB backends much easier.

I'd recommend using the registerMETA('FOO', many => 1, allow => [qw(bar cat)]) rather than require, so that changes to the schema as the plugin evolves can be more graceful (the failure mode with requires opt is rather ugly IMHO).

-- PaulHarvey - 31 Jan 2012

And, you may already be aware, but if not: you could do alias => 'workflowhistories' so the search could be written %SEARCH{"form.name ~ '*ProcedureForm' AND workflowhistories[state = 'APROVADO']" - but there are benefits to avoiding that (Eg. querying on the alias won't work if the plugin that registers that type is disabled).

-- PaulHarvey - 31 Jan 2012
 
Topic revision: r4 - 31 Jan 2012, PaulHarvey
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy