Tagged: 

  • This topic has 12 replies, 3 voices, and was last updated 8 years ago by chan.
Viewing 11 reply threads
  • Author
    Posts
    • #1102
      preston
      Member

      I have a post-relate field working with custom post types on my dev server, but the same setup on my production server gives me this error when saving the post.

      Warning: substr_compare() [function.substr-compare]: The length cannot exceed initial string length in /home/koavac/public_html/wp-content/plugins/piklist/includes/class-piklist-form.php on line 1474
      
      Warning: Cannot modify header information - headers already sent by (output started at /home/koavac/public_html/wp-content/plugins/piklist/includes/class-piklist-form.php:1474) in /home/koavac/public_html/wp-admin/post.php on line 222
      
      Warning: Cannot modify header information - headers already sent by (output started at /home/koavac/public_html/wp-content/plugins/piklist/includes/class-piklist-form.php:1474) in /home/koavac/public_html/wp-includes/pluggable.php on line 875

      When I remove the post-relate meta box, no error. Any ideas?

      WordPress 3.6.1
      Piklist 0.8.0b5

    • #1103
      Steve
      Keymaster

      Can you post your post-relate code?

    • #1104
      preston
      Member

      [theme]/piklist/parts/meta-boxes/location-related.php

      <?php
      /*
      Title: Available Homes
      Post Type: location
      Order: 10
      Priority: default
      Context: side
      Collapse: false
      */
      
        piklist('field', array(
          'type' => 'post-relate'
          ,'scope' => 'home'
          ,'template' => 'field'
        ));
      
        piklist('shared/code-locater', array(
          'location' => __FILE__
          ,'type' => 'Meta Box'
        ));
    • #1105
      Steve
      Keymaster

      Try ,'scope' => 'post'

    • #1109
      Steve
      Keymaster

      We will be writing some documentation on “Scope”, but for now think of it as where you want the data to be saved: “post”, “post_meta”, etc.

    • #1135
      preston
      Member

      'scope' => 'post' changes the related items to posts.

      What I want to do here is related two custom post types, location and home.

    • #1136
      preston
      Member

      Same error with 0.8.0b6, btw.

    • #1137
      Steve
      Keymaster

      We’re not seeing an error in Beta 6. I changed scope to piklist_demo and it worked fine:

        piklist('field', array(
          'type' => 'post-relate'
          ,'scope' => 'piklist_demo'
          ,'template' => 'field'
        ));

      Make sure your CPTs are registered and there is PUBLISHED content.

    • #1139
      preston
      Member

      I confirmed the post types are registered and have published posts. I even re-created the posts to make sure they have clean meta data.

      The odd thing is that this error only shows up on my production server, not my local dev server.

      They are both running

      PHP 5.2.17
      WordPress 3.6.1
      Piklist 0.8.0b6

    • #1140
      preston
      Member

      I’m able to reproduce this with Piklist Demos as well.

      1. Piklist Demos > Add New Piklist Demo

      2. Give the post a title and click Save.

      Warning: substr_compare() [function.substr-compare]: The length cannot exceed initial string length in /home/koavac/public_html/wp-content/plugins/piklist/includes/class-piklist-form.php on line 1475
      
      Warning: Cannot modify header information - headers already sent by (output started at /home/koavac/public_html/wp-content/plugins/piklist/includes/class-piklist-form.php:1475) in /home/koavac/public_html/wp-includes/pluggable.php on line 875
    • #1143
      Steve
      Keymaster

      I tried reproducing a few setups and can’t. Please delete your current version of Piklist, and then download and install Beta 6 again.

    • #1145
      preston
      Member

      Thanks Steve,

      I was still getting the error after deactivating, deleting, and re-installing the plugin.

      I’m now using Posts 2 Posts for post relationships, which seems to work fine with piklist created custom post types.

      • #1304
        chan
        Member

        I actually got this error on my live server, which was running php version 5.2.17. On my development server I didn’t get the error.

        I believe it is the PHP version.

        PHP version PHP Version 5.2.17 –> caused the error.

        PHP 5.3 – works

        PHP 5.4.3 works

Viewing 11 reply threads
  • You must be logged in to reply to this topic.