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

cctm_post_form multi-select and json issue? #473

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm testing the [cctm_post_form] shortcode which is a brilliant addition by the 
way!

I'm getting errors with multi select checkboxes (cctm_muticheckbox). They work 
fine in the Wordpress admin page but when used on the front end with the 
shortcode I get the following error;

Warning: json_decode() expects parameter 1 to be string, array given in 
/home/xxxxxxxx/wp-content/plugins/custom-content-type-manager/includes/CCTM_Form
Element.php on line 628

Warning: html_entity_decode() expects parameter 1 to be string, array given in 
/home/xxxxxxxx/wp-content/plugins/custom-content-type-manager/fields/multiselect
.php on line 183

I also noticed that if I add a record with a validation error, the fields are 
populated with un-decoded values like apostrophies are '

*SYSTEM INFO* 
------------------------ 
Plugin Version: 0.9.7.1-dev
WordPress Version: 3.5.1
PHP Version: 5.3.10
MySQL Version: 5.1.68-cll
Server OS: Linux
------------------------ 
ACTIVE PLUGINS: 
 * Contact Form 7 v.3.3.3 [http://contactform7.com/]
------------------------ 
CURRENT THEME: TestTheme v. 

Original issue reported on code.google.com by ThomasDa...@gmail.com on 25 Mar 2013 at 4:57

GoogleCodeExporter commented 9 years ago
Glad your'e testing it.  Yes, it's not ready for release yet.  I've encountered 
a few other problems too that I'm trying to work out before I can release this 
version.

Original comment by ever...@fireproofsocks.com on 25 Mar 2013 at 10:13

GoogleCodeExporter commented 9 years ago
Would LOVE to use this feature in a few live sites. Any ideas on when this 
feature might make it into the release?

Original comment by ThomasDa...@gmail.com on 26 Mar 2013 at 10:20

GoogleCodeExporter commented 9 years ago
Soon.  I'm on vacation now (supposedly), but this is going out with the next 
numbered release, one month at tops.

Original comment by ever...@fireproofsocks.com on 26 Mar 2013 at 2:27

GoogleCodeExporter commented 9 years ago
This was a trip through the wormhole... so many workarounds to make this work 
in WP... aarrrg.

The CCTM_FormElement->get_value() function expects its inputs to be JSON 
encoded, but when we're submitting them on the front-end like this, they come 
through as a regular array.  So I updated the get_value function to work with 
native PHP arrays.

Committed revision 747606.

Original comment by ever...@fireproofsocks.com on 29 Jul 2013 at 4:26