Forum

Thread tagged as: Problem

Region persistently saving as draft?

I have a region on my page that, no matter how many times I untick the 'save as draft' box when saving, refuses to be made live - it always shows up in the admin panel as a draft, and the page on the site won't show the new content. I can't seem to replicate the persistent draft behaviour with any other region on the site.

Here's the diagnostic report:

Perch: 2.8.4, PHP: 5.6.6, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $, with PDO
Server OS: WINNT, cgi-fcgi
Installed apps: content (2.8.4), assets (2.8.4), categories (2.8.4), perch_backup (1.2)
App runtimes: <?php $apps_list = array( 'content', 'categories', );
PERCH_LOGINPATH: /manage
PERCH_PATH: D:\home\site\wwwroot\manage
PERCH_CORE: D:\home\site\wwwroot\manage\core
PERCH_RESFILEPATH: D:\home\site\wwwroot\manage\resources
Image manipulation: GD
PHP limits: Max upload 8M, Max POST 8M, Memory: 128M, Total max file upload: 8M
Resource folder writeable: Yes
SCRIPT_NAME: /manage/core/settings/diagnostics/index.php
REQUEST_URI: /manage/core/settings/diagnostics/
DOCUMENT_ROOT: D:\home\site\wwwroot
HTTP_HOST: --REDACTED--

The region in question is using a custom fieldtype - I can make this available via DropBox if you need to see it.

Any ideas why this could be happening?

Mike Armstrong

Mike Armstrong 0 points

  • 6 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

It sounds like you have an error in your Field Type.

Have you checked your PHP error log?

I can't find the PHP logs (the website is hosted on Windows Azure, which is somewhat opaque) but I'm getting this error from the Perch debug when saving:

Invalid query: SQLSTATE[HY000]: General error: 1366 Incorrect string value: '\xE3\xA2nlin...' for column 'regionHTML' at row 1

Could this be the issue? The region is a list of people, and some of them have accented names...

Drew McLellan

Drew McLellan 2638 points
Perch Support

Perch will save the revision as a draft if the update fails for any reason - it's a failsafe against messing up your site when something goes wrong.

The invalid query would do it.

Yep, the issue was due to an incorrectly-encoded accented character. I've made sure those are properly encoded, and the page saves as it should.

Drew, I'm sure you mentioned that failsafe to me before - but it was a long time ago! I'll make sure to remember it next time.