Support » Plugin: Blog Manager Light » Featured images won’t show

  • Instead of featured images showing I get warnings.

    e.g. Warning: Illegal string offset ‘media_type’ in /app/public/wp-content/plugins/blog-manager-light/classes/otw_dispatcher.php on line 192

    Warning: Illegal string offset ‘featured_img’ in /app/public/wp-content/plugins/blog-manager-light/classes/otw_dispatcher.php on line 193

    Warning: Illegal string offset ‘media_type’ in /app/public/wp-content/plugins/blog-manager-light/skeleton/components/media.php on line 55

    Is there any fix for this, or has development on this free plugin been abandoned?

Viewing 1 replies (of 1 total)
  • I know that I am not the plugin developer, but I came upon this same issue and was able to resolve it by adding an additional line to the otw_dispatcher.php script referenced in the warning message. It seems to be a compatibility issue related to PHP 7.0.

    Lines 192 and 193 of otw_dispatcher.php look like this:

    
          $postMetaData['media_type']   = 'wp-native';
          $postMetaData['featured_img'] = $postAttachement;
    

    To correct the issue, I prepended (that is to say, inserted before) an additional line of script before the problem lines. My fixed version (now lines 192, 193, and 194) looks like this:

    
          $postMetaData = array();
          $postMetaData['media_type']   = 'wp-native';
          $postMetaData['featured_img'] = $postAttachement;
    

    For some reason, after transitioning to a hosted environment running PHP7, the above block of logic stopped automagically assuming an array when those two values were assigned, almost as if the script had spontaneously developed stronger typing. By explicitly declaring it as an array just prior to assignment things started working again.

Viewing 1 replies (of 1 total)
  • The topic ‘Featured images won’t show’ is closed to new replies.