{"id":206,"date":"2010-07-29T13:42:08","date_gmt":"2010-07-29T13:42:08","guid":{"rendered":"http:\/\/www.myfatblog.co.uk\/?p=206"},"modified":"2010-07-29T13:55:38","modified_gmt":"2010-07-29T13:55:38","slug":"206","status":"publish","type":"post","link":"http:\/\/www.myfatblog.co.uk\/index.php\/2010\/07\/206\/","title":{"rendered":"Weird CQWP behaviour with custom user columns"},"content":{"rendered":"<p>So one of my colleagues approached me today with a problem he was having setting up a new content query web part for a client. it\u00e2\u20ac\u2122s a fairly simple affair that just needs to pull together project statuses across a site collection. No cross site query issues, no custom field types to worry about.. Just a simple list.<\/p>\n<p>Or so we thought, Try as we might we could not get two of the fields to return a value, BusinessOwner and ProjectManager. In the Content Type, these site columns are simple People or Group field types, set to display the name without presence. <\/p>\n<p>Without any further ado I fired up my trusty development VM and started playing around to re-create the issue.<\/p>\n<ol>\n<li>Create a new content type based on the List Content Types\/Item parent. published to Custom Content Types group. <\/li>\n<li>Added a new site column called GreenBanana to the new content type. This is set to be a People or Group column, with the additional settings of Not required, No multiselect,People Only, All users and show field as name (Subsequently tested with Name and Presence and no difference.) <\/li>\n<li>To simulate the nested nature of the query in the client environment, I create a new sub-site in my site collection, added a new list and configured this list to use the new content type. <\/li>\n<li>Create 2-3 new items in the list, ensuring that the GreenBanana field has a value of my test user configured. <\/li>\n<li>Back to the root site of the Site Collection, create a new content query web part on the page and set it up to retrieve the new content type frm all sites in the site collection. As expected, the 3 new items duly appear. <\/li>\n<li>Now we export the CQWP to point it at the custom XSL that I have prepared. In addition I\u00e2\u20ac\u2122m adding &#8220;GreenBanana,Text; to the CommonViewFields property to make it available in the returned XML. (Note: I\u00e2\u20ac\u2122m using Text not User as the field type.) <\/li>\n<li>Delete the original CQWP and upload my newly updated one. <\/li>\n<\/ol>\n<p>The newly uploaded one shows me the 3 items that I expect, so modify shared webpart and point the item style at my showXML style. (Just a simple XSL that outputs all of the available fields and their values.)<br \/>\nThe heading GreenBanana shows, but not value.<br \/>\nSo, we\u00e2\u20ac\u2122re at the stage that my colleague got to, No value in the custom site column based on the people type.  Just an heading and an empty value. <\/p>\n<blockquote><p>P:GreenBanana<br \/>\nV:<\/p><\/blockquote>\n<p>So, thinking that I might be pulling an item frm somewhere else (despite this being a new content type) I decided to filter only on items that included me in the GreenBanana column.<\/p>\n<blockquote><p>P:GreenBanana<br \/>\nV:1;#Paul<\/p><\/blockquote>\n<p>Whoa.. Ok, why did that happen? It is definitely the same item that I had previously, but now I have a value. Setting the filter to be Show me everything where the GreenBanana column is not equal to Administrator shows me all three items AND their values.<\/p>\n<p>Weird.. and at the moment I don\u00e2\u20ac\u2122t have an explanation.<\/p>\n<p>Paul.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So one of my colleagues approached me today with a problem he was having setting up a new content query web part for a client. it\u00e2\u20ac\u2122s a fairly simple affair that just needs to pull together project statuses across a site collection. No cross site query issues, no custom field types to worry about.. Just &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/www.myfatblog.co.uk\/index.php\/2010\/07\/206\/\">Continue reading<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[25,3],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Weird CQWP behaviour with custom user columns - Blog of an overweight SharePoint addict<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.myfatblog.co.uk\/index.php\/2010\/07\/206\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Weird CQWP behaviour with custom user columns - Blog of an overweight SharePoint addict\" \/>\n<meta property=\"og:description\" content=\"So one of my colleagues approached me today with a problem he was having setting up a new content query web part for a client. it\u00e2\u20ac\u2122s a fairly simple affair that just needs to pull together project statuses across a site collection. No cross site query issues, no custom field types to worry about.. Just &hellip; Continue reading\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.myfatblog.co.uk\/index.php\/2010\/07\/206\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog of an overweight SharePoint addict\" \/>\n<meta property=\"article:published_time\" content=\"2010-07-29T13:42:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2010-07-29T13:55:38+00:00\" \/>\n<meta name=\"author\" content=\"Cimares\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@cimares\" \/>\n<meta name=\"twitter:site\" content=\"@cimares\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Cimares\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.myfatblog.co.uk\/index.php\/2010\/07\/206\/\",\"url\":\"https:\/\/www.myfatblog.co.uk\/index.php\/2010\/07\/206\/\",\"name\":\"Weird CQWP behaviour with custom user columns - Blog of an overweight SharePoint addict\",\"isPartOf\":{\"@id\":\"http:\/\/www.myfatblog.co.uk\/#website\"},\"datePublished\":\"2010-07-29T13:42:08+00:00\",\"dateModified\":\"2010-07-29T13:55:38+00:00\",\"author\":{\"@id\":\"http:\/\/www.myfatblog.co.uk\/#\/schema\/person\/55ae8f6885bb5b8390dad001f3da83c6\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.myfatblog.co.uk\/index.php\/2010\/07\/206\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/www.myfatblog.co.uk\/#website\",\"url\":\"http:\/\/www.myfatblog.co.uk\/\",\"name\":\"Blog of an overweight SharePoint addict\",\"description\":\"The rantings of a (not so) food obsessed IT consultant!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/www.myfatblog.co.uk\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"http:\/\/www.myfatblog.co.uk\/#\/schema\/person\/55ae8f6885bb5b8390dad001f3da83c6\",\"name\":\"Cimares\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/www.myfatblog.co.uk\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/About_D057\/TopOfTheWorld.jpg\",\"contentUrl\":\"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/About_D057\/TopOfTheWorld.jpg\",\"caption\":\"Cimares\"},\"sameAs\":[\"http:\/\/www.myfatblog.co.uk\"],\"url\":\"http:\/\/www.myfatblog.co.uk\/index.php\/author\/reginald\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Weird CQWP behaviour with custom user columns - Blog of an overweight SharePoint addict","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.myfatblog.co.uk\/index.php\/2010\/07\/206\/","og_locale":"en_US","og_type":"article","og_title":"Weird CQWP behaviour with custom user columns - Blog of an overweight SharePoint addict","og_description":"So one of my colleagues approached me today with a problem he was having setting up a new content query web part for a client. it\u00e2\u20ac\u2122s a fairly simple affair that just needs to pull together project statuses across a site collection. No cross site query issues, no custom field types to worry about.. Just &hellip; Continue reading","og_url":"https:\/\/www.myfatblog.co.uk\/index.php\/2010\/07\/206\/","og_site_name":"Blog of an overweight SharePoint addict","article_published_time":"2010-07-29T13:42:08+00:00","article_modified_time":"2010-07-29T13:55:38+00:00","author":"Cimares","twitter_card":"summary_large_image","twitter_creator":"@cimares","twitter_site":"@cimares","twitter_misc":{"Written by":"Cimares","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.myfatblog.co.uk\/index.php\/2010\/07\/206\/","url":"https:\/\/www.myfatblog.co.uk\/index.php\/2010\/07\/206\/","name":"Weird CQWP behaviour with custom user columns - Blog of an overweight SharePoint addict","isPartOf":{"@id":"http:\/\/www.myfatblog.co.uk\/#website"},"datePublished":"2010-07-29T13:42:08+00:00","dateModified":"2010-07-29T13:55:38+00:00","author":{"@id":"http:\/\/www.myfatblog.co.uk\/#\/schema\/person\/55ae8f6885bb5b8390dad001f3da83c6"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.myfatblog.co.uk\/index.php\/2010\/07\/206\/"]}]},{"@type":"WebSite","@id":"http:\/\/www.myfatblog.co.uk\/#website","url":"http:\/\/www.myfatblog.co.uk\/","name":"Blog of an overweight SharePoint addict","description":"The rantings of a (not so) food obsessed IT consultant!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/www.myfatblog.co.uk\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"http:\/\/www.myfatblog.co.uk\/#\/schema\/person\/55ae8f6885bb5b8390dad001f3da83c6","name":"Cimares","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/www.myfatblog.co.uk\/#\/schema\/person\/image\/","url":"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/About_D057\/TopOfTheWorld.jpg","contentUrl":"http:\/\/www.myfatblog.co.uk\/images\/BlogImages\/About_D057\/TopOfTheWorld.jpg","caption":"Cimares"},"sameAs":["http:\/\/www.myfatblog.co.uk"],"url":"http:\/\/www.myfatblog.co.uk\/index.php\/author\/reginald\/"}]}},"_links":{"self":[{"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/206"}],"collection":[{"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=206"}],"version-history":[{"count":5,"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/206\/revisions"}],"predecessor-version":[{"id":211,"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/206\/revisions\/211"}],"wp:attachment":[{"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=206"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/categories?post=206"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.myfatblog.co.uk\/index.php\/wp-json\/wp\/v2\/tags?post=206"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}