• Resolved mzah8

    (@mzah8)


    This is for VSEL v.14.2 and v.14.3 (which I understand just updated in the past 24 hours).

    I’m getting this error as reported by WP’s built-in email alerts:

    An error of type E_ERROR was caused in line 40 of the file /[redacted]/wp-content/plugins/very-simple-event-list/vsel-acf.php. Error message: Uncaught Error: Object of class WP_Post could not be converted to string in /[redacted]/wp-content/plugins/very-simple-event-list/vsel-acf.php:40

    I first noticed that one particular Event I created has an error on its single event page, whereby it only shows the title and featured image, and the rest of the page cuts off there – no event details, the website footer doesn’t appear, etc.

    I’m still trying to figure out why this happens – I’ve tried removing the featured image, removing all the blocks leaving only the title, changing the dates, and still the page cuts off.

    After encountering that issue, I then tried to edit a Page where I added the [vsel] shortcode, and that’s when I got a Critical Error message from WP causing the above error to be e-mailed to me. Probably related to the same Event. I don’t get the error on pages without the shortcode.

    I’m on WordPress 6.0 and PHP 7.4.28. Hope this is enough info! Thanks in advance for any help.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Guido

    (@guido07111975)

    Hi,

    This is probably caused by the extra fields that are added with the Advanced Custom Fields plugin. Do you have custom fields? I always have this plugin installed as well, and with my current test fields no problem.

    Guido

    Thread Starter mzah8

    (@mzah8)

    Thanks Guido for your reply,

    I did suspect the custom fields earlier, but when I disabled the specific field group via ACF for Event post types, it did not change the outcome.

    However after reading your reply, I disabled the ACF plugin itself and sure enough the page is now showing properly.

    After trying out different things, I realised that the offending custom field is one of the “Post Object” type in ACF and the errors occur when the field has a value.

    When I changed the field’s “Return Format” option from Post Object to Post ID, the page shows properly and I no longer get the critical error on the page containing the shortcode.

    So I guess that’s ‘fixed’? Haha! Thanks for pointing me in the right direction.

    – M

    Thread Starter mzah8

    (@mzah8)

    Forgot to add screenshot of the “Return Format” option in ACF, if anyone needs it:

    https://snipboard.io/XZAfKx.jpg

    Plugin Author Guido

    (@guido07111975)

    Thanks a lot for your reply. Based on the error I did came to the conclusion I had to include a check whether the value is an array or object but your reply does help me a lot because I could not find a field type that can return an object (maybe I don’t look good enough). So can you tell me which field type this is?

    Guido

    Plugin Author Guido

    (@guido07111975)

    Hi again,

    Found it, it’s the Post Object field type. Will fix this asap.

    Guido

    Thread Starter mzah8

    (@mzah8)

    Hi Guido,

    Yes that’s the one. Thank you for the update!

    – M

    Plugin Author Guido

    (@guido07111975)

    Hi M,

    I have just updated plugin. Should be fixed now.

    Guido

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Object of class WP_Post could not be converted to string’ is closed to new replies.