- This topic has 6 replies, 3 voices, and was last updated 4 years, 10 months ago by
Steve.
-
AuthorPosts
-
-
September 20, 2016 at 6:07 am #7353
tirins007ParticipantHi
When I follow this tut: https://piklist.com/learn/doc/replacing-wordpress-post-editor/ and replace an editor for a CPT i get an error if I leave ‘scope’ => ‘post’ in field definition.
here is my field definition
piklist('field', array( 'type' => 'editor', 'field' => 'post_content', 'scope' => 'post', 'label' => 'Blurb', 'description' => 'A little write-up', 'template' => 'default', 'options' => array( 'wpautop' => true, 'media_buttons' => true, 'shortcode_buttons' => true, 'teeny' => false, 'dfw' => false, 'quicktags' => true, 'drag_drop_upload' => true, 'tinymce' => array( 'resize' => true, 'wp_autoresize_on' => false ) ) ));error’s call stack goes like this:
Call Stack # Time Memory Function Location 1 0.0020 414728 {main}( ) .../post.php:0 2 0.4912 22309800 include( '/srv/www/clove/current/web/wp/wp-admin/edit-form-advanced.php' ) .../post.php:173 3 0.5871 22905984 do_meta_boxes( ) .../edit-form-advanced.php:693 4 0.5876 22906544 Piklist_Meta::meta_box( ) .../template.php:1045 5 0.5876 22906920 Piklist::render( ) .../class-piklist-meta.php:312 6 0.5885 22915568 include( '/srv/www/clove/current/web/app/themes/sage/piklist/parts/meta-boxes/piklist-person.php' ) .../class-piklist.php:507 7 0.5924 22971824 piklist( ) .../piklist-person.php:23 8 0.5924 22971824 Piklist_Form::render_field( ) .../class-piklist.php:2456 9 0.5924 22975712 Piklist_Form::get_field_value( ) .../class-piklist-form.php:1660 -
September 20, 2016 at 11:23 am #7355
JasonKeymasterHi @tirins007!
What’s the specific error, please? Thank you for providing the call stack but it helps to have the error, too. 🙂
Also, which version of PHP are you using?
Thanks!
-
September 20, 2016 at 6:38 pm #7358
tirins007ParticipantSorry my bad. It actually is a notice not an error:
Notice: Array to string conversion in /srv/www/clove/current/web/app/plugins/piklist/includes/class-piklist-form.php on line 923
My php version is 7.0.9 -
September 20, 2016 at 6:47 pm #7359
JasonKeymasterGotcha. I actually just fixed this today which will be included in the next release. PHP 7 changed the order in which nested variables are evaluated. To tie you over until the next release, go to that file and change the culprit line from
array_push($return, $object->$field['field'] ? $object->$field['field'] : $field['value']);
to this
array_push($return, $object->{$field['field']} ? $object->{$field['field']} : $field['value']);Hope this helps! 🙂
-
September 20, 2016 at 7:01 pm #7360
tirins007Participantfixed, awesome!
-
September 21, 2016 at 11:33 am #7366
JasonKeymasterGreat! Glad to help!
-
March 30, 2017 at 1:43 pm #7870
-
-
AuthorPosts
- The topic ‘error when replacing editor and specifying scope as post’ is closed to new replies.