Tagged: error, field, hidden field
- This topic has 19 replies, 5 voices, and was last updated 5 years, 5 months ago by
vayu.
-
AuthorPosts
-
-
November 6, 2015 at 10:21 am #4887
ndbeMemberI got this field:
piklist('field',array( 'type'=>'hidden', 'field'=>'latLng' ));And I can access this value from front but in the admin side the field gives me an error:
<input type="hidden" id="_post_meta_latLng_0" name="_post_meta[latLng]" value=" Notice: Array to string conversion in [...]/wp-includes/formatting.php on line 959 Array" class="_post_meta_latLng piklist-field-element" data-piklist-field-addmore-clear="0">I checked DB and the values in tables are correct. Exemple value saved in DB:
53.45258580956264,14.464406390869158 -
November 6, 2015 at 10:42 am #4889
ndbeMemberAfter changing to:
piklist('field',array( 'type'=>'text', 'field'=>'latLng' ));everything works fine.
-
November 6, 2015 at 11:36 am #4890
-
November 10, 2015 at 11:38 am #4911
SteveKeymasterThis will be fixed in Piklist v0.9.9.7
-
February 15, 2016 at 8:11 am #5926
kplanetaMemberUpdate in 0.9.9.7 fixed nothing. Whenever I save anything into a hidden field I get “Array” in its value.
-
February 20, 2016 at 6:42 pm #5961
SteveKeymasterYou’re passing a value and just getting an empty array?
-
February 20, 2016 at 6:57 pm #5968
kplanetaMemberTake a look at the vid > https://dl.dropboxusercontent.com/u/16604210/Hidden-saved-as-array.wmv
By positioning the marker on the map the value of the hidden field changes. When I save the page, the value in this field is “Array”.
-
February 20, 2016 at 7:12 pm #5972
SteveKeymasterCan you post your field code? Is
'add_more' => trueset? -
February 20, 2016 at 7:15 pm #5973
kplanetaMemberAdd more is not set. The field code is
piklist('field',array( 'type' => 'hidden' ,'field' => $prefix . 'latLang' ,'value' => '53.010272, 18.605023' ,'attributes' => array( 'maxlength' => 50 ) ,'validate' => array( array( 'type' => 'limit' ,'options' => array( 'max' => 50 ) ) ) )); -
February 20, 2016 at 7:24 pm #5974
kplanetaMemberOh, I forgot to mention that I tried removing “attributes” and “validate”, but the effect was exactly the same.
-
February 20, 2016 at 7:24 pm #5975
SteveKeymasterCan you email the entire meta box to [email protected] ?
-
February 22, 2016 at 8:44 am #5983
kplanetaMemberDone.
-
February 23, 2016 at 1:48 pm #5994
-
March 1, 2016 at 12:45 pm #6021
-
March 10, 2016 at 10:53 am #6047
-
July 13, 2016 at 7:12 am #6946
Tonny KeukenMemberThis reply has been marked as private. -
July 13, 2016 at 7:14 am #6947
Tonny KeukenMemberThis reply has been marked as private. -
July 15, 2016 at 9:24 am #6954
SteveKeymaster@tonnykeuken– This is fixed in the next major version.
Posting your fix here for other:
In the “piklist” plugin folder go to: plugins/piklist/parts/fields/hidden.php, and change the line (6):
from: value=””
to: value=” -
September 2, 2016 at 5:39 am #7297
vayuMemberHi Steve.
When I download the latest version of Piklist v0.9.9.9 I see that the hidden field value is still not fixed.
It still returns:
value="<?php echo esc_attr($value); ?>"
and not
value="<?php echo is_array($value) ? esc_attr(end($value)) : esc_attr($value); ?>"Should it not do that or do a have a reason for not implementing this after all?
-
September 2, 2016 at 5:45 am #7298
vayuMemberOh, it just occurred to me that maybe you wrote this, when it was on version v0.9.9.9. If so, then I will edit the file myself and look forward to the next major release. 😉
-
-
AuthorPosts
- You must be logged in to reply to this topic.