Forum Discussion

Claudius's avatar
4 years ago

Messages count(*) wrong when applying content_workflow.state filter

I am building a content dashboard which should give an overview of content workflow states across different blogs and TKBs. But I get the wrong message count back. Let me talk you through it:
Here's the new dashboard of the blog I am looking at. I created two articles, one in draft and one in review:

 


When querying SELECT id, subject FROM messages WHERE board.id='whats-new' AND content_workflow.state='draft' I get

 

{
  "status" : "success",
  "message" : "",
  "http_code" : 200,
  "data" : {
    "type" : "messages",
    "list_item_type" : "message",
    "size" : 1,
    "items" : [ {
      "type" : "message",
      "id" : "2339",
      "subject" : "Draft article"
    } ]
  },
  "metadata" : { }
}

 

which is expected.

Now if I replace the requested fields to get the message count: SELECT count(*) FROM messages WHERE board.id='whats-new' AND content_workflow.state='draft'count(*) then suddenly the count increases to 6:

 

{
  "status" : "success",
  "message" : "",
  "http_code" : 200,
  "data" : {
    "count" : 6
  },
  "metadata" : { }
}

 

 

Can anyone see what I'm doing wrong or is this a bug in LiQL?