Pixie CMS Error: “Privs is a required field”
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’s content you get one of several validation errors.
- Privs is a required field
- Publish is a required field
- and so on…
Solution:
- Delete all effected pages.
- Create them again, and make sure your Page Description doesn’t include symbols (the one that caused me problems was a pipe: | ).
- Avoid complex Page Descriptions until this bug is fixed.
It is that simple, but if you would like more of a description, read on.
Recreating the problem
1 – create new page “press”
2 – from pixie publish, add content “test one test two”
3 – update = success
4 – view page = content displays correctly
5 – click “edit this page”
6 – add content “test three”
7 – click update = success
8 – view page = content displays correctly
9 – click “edit this page”
10 – add content “| test four|”
11 – click update = “Privs is a required field”
12 – view page = content displays correctly
13 – click “edit this page”
14 – content displayed on webpage does not appear in the edit “press”
page; only “test one test two test three” appears
15 – add content again “| test four|”
16 – click update = “Publish is a required field”**at first i thought it was the “edit this page” link from the webpage
itself that was causing the problem. but now it appears to be
inserting a “|” in my content that does it.however, there are additional conditions…
1 – create new page “linktest”
2 – from pixie publish, add content and link “test link one”
3 – update = success
4 – view page = content displays/functions correctly
5 – click “edit this page”
6 – add content and link “test link two”
7 – click update = success
8 – view page = content displays/functions correctly
9 – click “edit this page”
10 – add content “| test link three |”
11 – click update = “Saved updates to the linktest page” **however,
the “| test link three |” doesn’t physically appear in the edit
content window and below the content window the following text appears:
test link three” maxlength=”12″ />
12 – view page = content displays/functions correctly
13 – click “edit this page”
14 – same content and random text from step 11 appears.
Troubleshooting the problem
On line 1024 of lib_core.php, you can uncomment
echo $sql; //view the SQL for current form save
I would then see output like the following when trying to save a page:
`page_type` = 'static',`page_name` = 'about',`page_display_name` = 'about',`page_description` = '
about gallery
',`page_blocks` = 'google_analytics',`page_content` = '
contact info
',`page_views` = ' location and hours ',`page_parent` = ' ',`privs` = '7',`publish` = '',`public` = '2',`in_navigation` = 'yes',`page_order` = '0',`searchable` = 'yes',`last_modified` = '20080907145610'
Notice the strange content in page_parent, privs, page_views, etc.
This record is in the pixie_core database table, and is created when you first setup the page. The problem problem isn’t with “editing”. The fields aren’t validating because the record of the page itself is screwed up.
Why did this happen? page_description isn’t getting cleaned correctly in the SQL insert statement. I haven’t had a chance to dig into that one yet. Fortunately the work around outline above works just as well.
Thanks to Kathryn for providing creating the condition and chatting with me on our bug-hunt.
Leave a Reply