{"id":241,"date":"2008-09-07T16:30:57","date_gmt":"2008-09-07T20:30:57","guid":{"rendered":"http:\/\/blog.jedbrubaker.com\/?p=241"},"modified":"2008-09-07T16:30:57","modified_gmt":"2008-09-07T20:30:57","slug":"pixie-cms-error-privs-is-a-required-field","status":"publish","type":"post","link":"https:\/\/www.whatknows.com\/blog\/2008\/09\/07\/pixie-cms-error-privs-is-a-required-field\/","title":{"rendered":"Pixie CMS Error: &#8220;Privs is a required field&#8221;"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.jedbrubaker.com\/wp-content\/uploads\/2008\/09\/pixie_logo_large.png\" alt=\"Pixie CMS Error: Privs is a required field\" title=\"Pixie CMS\" width=\"127\" height=\"127\" class=\"alignright size-full wp-image-245\" align=\"right\" \/>It looks like it is a Pixie CMS weekend. The following error was giving me some trouble, so hopefully throwing this out into the blogosphere will save someone some time.<\/p>\n<p><strong>Problem:<\/strong> When updating a static page&#8217;s content you get one of several validation errors.<\/p>\n<ul>\n<li>Privs is a required field<\/li>\n<li>Publish is a required field<\/li>\n<li>and so on&#8230;<\/li>\n<\/ul>\n<p><strong>Solution:<\/strong><\/p>\n<ol>\n<li>Delete all effected pages.<\/li>\n<li>Create them again, and make sure your Page Description doesn&#8217;t include symbols (the one that caused me problems was a pipe: | ).<\/li>\n<li>Avoid complex Page Descriptions until this bug is fixed.<\/li>\n<\/ol>\n<p>It is that simple, but if you would like more of a description, read on.<br \/>\n<!--more--><br \/>\n<strong><br \/>\nRecreating the problem<\/strong><\/p>\n<blockquote>\n<p>1 &#8211; create new page &#8220;press&#8221;<br \/>\n2 &#8211; from pixie publish, add content &#8220;test one test two&#8221;<br \/>\n3 &#8211; update = success<br \/>\n4 &#8211; view page = content displays correctly<br \/>\n5 &#8211; click &#8220;edit this page&#8221;<br \/>\n6 &#8211; add content &#8220;test three&#8221;<br \/>\n7 &#8211; click update = success<br \/>\n8 &#8211; view page = content displays correctly<br \/>\n9 &#8211; click &#8220;edit this page&#8221;<br \/>\n10 &#8211; add content &#8220;| test four|&#8221;<br \/>\n11 &#8211; click update = &#8220;Privs is a required field&#8221;<br \/>\n12 &#8211; view page = content displays correctly<br \/>\n13 &#8211; click &#8220;edit this page&#8221;<br \/>\n14 &#8211; content displayed on webpage does not appear in the edit &#8220;press&#8221;<br \/>\npage; only &#8220;test one test two test three&#8221; appears<br \/>\n15 &#8211; add content again &#8220;| test four|&#8221;<br \/>\n16 &#8211; click update = &#8220;Publish is a required field&#8221;<\/p>\n<p>**at first i thought it was the &#8220;edit this page&#8221; link from the webpage<br \/>\nitself that was causing the problem.  but now it appears to be<br \/>\ninserting a &#8220;|&#8221; in my content that does it.<\/p>\n<p>however, there are additional conditions&#8230;<\/p>\n<p>1 &#8211; create new page &#8220;linktest&#8221;<br \/>\n2 &#8211; from pixie publish, add content and link &#8220;test link one&#8221;<br \/>\n3 &#8211; update = success<br \/>\n4 &#8211; view page = content displays\/functions correctly<br \/>\n5 &#8211; click &#8220;edit this page&#8221;<br \/>\n6 &#8211; add content and link &#8220;test link two&#8221;<br \/>\n7 &#8211; click update = success<br \/>\n8 &#8211; view page = content displays\/functions correctly<br \/>\n9 &#8211; click &#8220;edit this page&#8221;<br \/>\n10 &#8211; add content &#8220;| test link three |&#8221;<br \/>\n11 &#8211; click update = &#8220;Saved updates to the linktest page&#8221; **however,<br \/>\nthe &#8220;| test link three |&#8221; doesn&#8217;t physically appear in the edit<br \/>\ncontent window and below the content window the following text appears:<br \/>\ntest link three<\/p>\n<p>&#8221; maxlength=&#8221;12&#8243; \/><\/p>\n<p>12 &#8211; view page = content displays\/functions correctly<br \/>\n13 &#8211; click &#8220;edit this page&#8221;<br \/>\n14 &#8211; same content and random text from step 11 appears.\n<\/p>\n<\/blockquote>\n<p><strong>Troubleshooting the problem<\/strong><\/p>\n<p>\nOn line 1024 of lib_core.php, you can uncomment<\/p>\n<p> <code>echo $sql; \/\/view the SQL for current form save<\/code><\/p>\n<p>\nI would then see output like the following when trying to save a page:<\/p>\n<p><code><br \/>\n`page_type` = 'static',`page_name` = 'about',`page_display_name` = 'about',`page_description` = '<br \/>\nabout gallery<br \/>\n',`page_blocks` = 'google_analytics',`page_content` = '<br \/>\ncontact info<br \/>\n',`page_views` = ' location and hours ',`page_parent` = ' ',`privs` = '7',`publish` = '',`public` = '2',`in_navigation` = 'yes',`page_order` = '0',`searchable` = 'yes',`last_modified` = '20080907145610'<br \/>\n<\/code><\/p>\n<p>Notice the strange content in page_parent, privs, page_views, etc. <\/p>\n<p>This record is in the pixie_core database table, and is created when you first setup the page. The problem problem isn&#8217;t with &#8220;editing&#8221;. The fields aren&#8217;t validating because the record of the page itself is screwed up.<\/p>\n<p>Why did this happen? page_description isn&#8217;t getting cleaned correctly in the SQL insert statement. I haven&#8217;t had a chance to dig into that one yet. Fortunately the work around outline above works just as well.<\/p>\n<p><em>Thanks to Kathryn for providing creating the condition and chatting with me on our bug-hunt.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It looks like it is a Pixie CMS weekend. The following error was giving me some trouble, so hopefully throwing this out into the blogosphere will save someone some time. Problem: When updating a static page&#8217;s content you get one of several validation errors. Privs is a required field Publish is a required field and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[6],"tags":[],"class_list":["post-241","post","type-post","status-publish","format-standard","hentry","category-technology"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pJP4m-3T","_links":{"self":[{"href":"https:\/\/www.whatknows.com\/blog\/wp-json\/wp\/v2\/posts\/241","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.whatknows.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.whatknows.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.whatknows.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.whatknows.com\/blog\/wp-json\/wp\/v2\/comments?post=241"}],"version-history":[{"count":0,"href":"https:\/\/www.whatknows.com\/blog\/wp-json\/wp\/v2\/posts\/241\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.whatknows.com\/blog\/wp-json\/wp\/v2\/media?parent=241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.whatknows.com\/blog\/wp-json\/wp\/v2\/categories?post=241"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.whatknows.com\/blog\/wp-json\/wp\/v2\/tags?post=241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}