• Resolved jamescl

    (@jamescl)


    I am encountering this error when loading some post edit pages: (/wp-admin/post.php?post=1234&action=edit):

    PHP Fatal error: Uncaught Error: Cannot use assign-op operators with string offsets in /wp-content/plugins/wonderm00ns-simple-facebook-open-graph-tags/admin/class-webdados-fb-open-graph-admin.php:404 Stack trace:
    #0 /wp-includes/class-wp-hook.php(324): Webdados_FB_Admin->post_updated_messages()
    #1 /wp-includes/plugin.php(205): WP_Hook->apply_filters() 
    #2 /wp-admin/edit-form-advanced.php(219): apply_filters() 
    #3 /wp-admin/post.php(206): require('...') 
    #4 {main} thrown in /wp-content/plugins/wonderm00ns-simple-facebook-open-graph-tags/admin/class-webdados-fb-open-graph-admin.php on line 404

    In my setup, this only seems to occur when trying to edit post types created by the mailster plugin, but the error could occur from other post types depending on the message types being returned for the post. It seems to be driven when the function post_updated_messages encounters unexpected message type data ( in this case set by mailster using $messages[] = 'message'; for use within post types created in that plugin); which does not have the expected array structure, causing a fatal error when trying to use .= in this plugin

    Adding a check at line 401 to bypass any non-array values fixes the issue:

    foreach ($messages as $type => $messages1) {
          if (!is_array($messages1)) {
              continue; 
          }

    I’m not sure if this would be the best fix? – possibly limiting to specific post types, or enabling certain post types to be excluded from this plugin more broadly would also solve the issue

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Daniyal Raza

    (@daniyalraza01)

    Hello @jamescl ,

    Thanks for contacting us. Hope you are doing well.

    I had forwarded this to our technical team. They are looking into this for you.

    We will update you soon here.

    Thanks & Regards,
    WP Experts Support Team

    Plugin Support Daniyal Raza

    (@daniyalraza01)

    Hello @jamescl ,

    Hope you are doing well.

    Can you please try again this thing with the updated plugin beta version. We have made some code changed. Here is download link below. Please re-install it into your site.

    Download Now

    Also, please make sure to take a backup before uploading this plugin on your site.

    Let me know if the issue still persist.

    Thanks 

    Thread Starter jamescl

    (@jamescl)

    Hi,

    Have tested this version and the issue is resolved.

    Thanks!

    Plugin Support Daniyal Raza

    (@daniyalraza01)

    Glad to hear that.

    I would really appreciate it if you can give us feedback/review regarding our plugin and support on our profile. It will be really helpful for us.

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Error when getting messages types in class-webdados-fb-open-graph-admin.php’ is closed to new replies.