google-code-export / wordpress-custom-content-type-manager

Automatically exported from code.google.com/p/wordpress-custom-content-type-manager
2 stars 1 forks source link

Post with required fields saved with post_status=publish, even with blank required fields. #544

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
My problem is very simple, and all is in the title.

I created a custom post type with CCTM, and I created extra fields. Some of 
them are required. 
When I create a new post of my custom post type, when I click on the "sumbit" 
button of the form, this post is saved in the posts table of wp, and the 
post_status is "publish", even if the required fields are blank.
I have the validation errors at the top of my form, but the post is really 
saved in the database, and the status is "publish".

This is a big problem for the application I am trying to build.

Thx for your help
Gilles Dumas

(I disabled all other plugins)
==================================

*SYSTEM INFO* 
------------------------ 
Plugin Version: 0.9.7.11-pl
WordPress Version: 3.8.1
PHP Version: 5.3.16
MySQL Version: 5.1.66-0+squeeze1-log
Server OS: Linux
Language: fr_FR
------------------------ 
ACTIVE PLUGINS: 
 * Advanced Custom Fields: Date and Time Picker v.2.0.12 [https://github.com/soderlind/acf-field-date-time-picker]
 * Advanced Custom Fields v.4.3.2 [http://www.advancedcustomfields.com/]
 * Contact Form DB v.2.6.3 [http://wordpress.org/extend/plugins/contact-form-7-to-database-extension/]
 * Contact Form 7 v.3.7 [http://contactform7.com/]
 * Get Options v.1.2.0 [http://wordpress.org/extend/plugins/get-options/]
 * GWP Order Taxonomy v.1.0 []
 * Log Viewer v.2013.05.19 [http://wordpress.org/extend/plugins/log-viewer/]
 * Pco Image Widget Field v.1.0.1 [http://peytz.dk/medarbejdere/]
 * Simple Taxonomy v.3.5 [https://github.com/herewithme/simple-taxonomy]
 * TinyMCE Advanced v.3.5.9.1 [http://www.laptoptips.ca/projects/tinymce-advanced/]
 * User Taxonomies v.1.0 [http://gostomski.co.uk/code/wordpress-user-taxonomies]
 * Which Template File v.2.1 []
 * WordPress Admin Error Handler v.0.1 []
 * WP Better Emails v.0.2.6.4 [http://wordpress.org/extend/plugins/wp-better-emails/]
 * Wp Pagenavi Style v.1.4 [http://www.snilesh.com/resources/wordpress/wordpress-pagenavi-style-plugin/]
 * WP-PageNavi v.2.85 [http://wordpress.org/extend/plugins/wp-pagenavi/]
------------------------ 
CURRENT THEME: SNITPECT v.1.0

Original issue reported on code.google.com by circusm...@gmail.com on 17 Feb 2014 at 3:03

Attachments:

GoogleCodeExporter commented 9 years ago
Looks like WP changed their post form.

Update includes/StandardizedCustomFields.php line 276 to this:

$post_id = (int) CCTM::get_value($_GET, 'post');

This forces the value to be read out of the $_GET array instead of out of the 
$_POST array.  The variable is passed in $_POST as post_ID, but for some 
reason, the value is removed before the validation action has time to get to it.

Committed revision 859492.

Original comment by ever...@fireproofsocks.com on 17 Feb 2014 at 4:09