• Resolved abuzon

    (@abuzon)


    A PHP warning just popped up, I think just today/yesterday, after the last Yoast update. Probably related to the “Open Graph integration for The Events Calendar plugin” added in 15.2.
    All plugins are on current versions.
    Warning: Attempt to assign property 'description' of non-object in /home/customer/www/medinarealtors.com/public_html/wp-content/plugins/wordpress-seo/src/generators/schema/third-party/events-calendar-schema.php on line 187

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 18 total)
  • Plugin Support Rumejan Barbarona

    (@onlyincebu)

    Hello @abuzon!

    This looks like a conflict between Yoast SEO and events calendar. Are both plugins updated? According to this, the latest version of The Events Calendar plugin is 5.2.1. Please also make sure that your WordPress and your theme are up-to-date.

    Thread Starter abuzon

    (@abuzon)

    Yes, all plugins are up to date, as is WP and themes.

    Plugin Support Md Mazedul Islam Khan

    (@mazedulislamkhan)

    Thanks for your confirmation. We visited the relevant page on your website and were able to reproduce the warning. It looks like the relevant warning is referring to the code here but we are not aware of such a confirm issue from anyone else yet. So, we think this is an issue specific to your setup.

    Can you please confirm whether you are running the latest version of WordPress, Yoast SEO, and the Event Callendar plugins?

    If yes, we’d like you to please perform a conflict check first to see whether there’s something else causing the issue on your setup. You can find the conflict check guide here.

    Thread Starter abuzon

    (@abuzon)

    It’s Modern Tribe’s Virtual Events plugin that’s causing it. Will head over to them.

    Plugin Support Md Mazedul Islam Khan

    (@mazedulislamkhan)

    Great, we are glad to hear that you found out the exact cause of the issue.

    Hi @mazedulislamkhan and @abuzon,

    I am one of the developers on The Events Calendar, someone from our support team brought this to my attention, and i wanted to make sure I investigated a little bit further.

    It seems like the Yoast integration and our Virtual Events add-on don’t play nice with each other due to our removal of a location when you tag a particular event as Virtual.

    
    		if ( empty( $data->location ) || ! is_object( $data->location ) ) {
    			// If the physical location is not present, then mark this event as online only.
    			$data->eventAttendanceMode = static::ONLINE_EVENT_ATTENDANCE_MODE;
    			$data->location            = (object) [
    				'@type' => 'VirtualLocation',
    				'url'   => esc_url( $this->get_virtual_url( $post ) ),
    			];
    		} else {
    			// If a physical location is set for the event, then assign both locations.
    			$data->eventAttendanceMode = static::MIXED_EVENT_ATTENDANCE_MODE;
    			$data->location            = [
    				(object) [
    					'@type' => 'VirtualLocation',
    					'url'   => esc_url( $this->get_virtual_url( $post ) ),
    				],
    				$data->location
    			];
    		}
    

    In the case of Mixed attendance, the JSON LD supports an array of items instead of just one object.

    Let me know if that helps.

    Thread Starter abuzon

    (@abuzon)

    Thank you so much @bordoni
    Sorry if this is a dumb question, but should I pop this in my functions.php, or is this intended for Yoast?

    Hi @abuzon, sorry for the confusion. No question is dumb, it’s totally fair, I should have explained it.

    That code above was just the piece from our Virtual Events plugin where the weird interaction with Yoast’s Open Graph comes from.

    To fix that problem you would likely need to overwrite a Yoast Plugin file, which is not ideal by any means.

    Hopefully the two teams can get a fix going for our customers.

    Thread Starter abuzon

    (@abuzon)

    @bordoni gotcha! thank you so much for jumping on this and being so responsive!
    I’ve disabled Yoast for now – between the two, Virtual Events is necessary to their daily operations. So if anyone’s looking for the error, that’s why it’s gone now.

    Tinelle Louis

    (@cocoabunny)

    I was having the same problem on a client’s site, however the two play just fine on another site. After finding this thread, I realized where the error was and it fixed it.

    I marked the event as Virtual, but I also entered a physical location. Once I removed the location the line 187 error went away.

    I hope this helps anyone else.

    Thread Starter abuzon

    (@abuzon)

    Hey Yoast, @mazedulislamkhan and @bordoni FYI, this problem is back.

    Warning: Attempt to assign property ‘description’ of non-object in …/wp-content/plugins/wordpress-seo/src/generators/schema/third-party/events-calendar-schema.php on line 188

    It was line 187 last time.

    Recommendations?

    @abuzon I’m not sure if you got it resolved or not, but I got the error for line 188 today and the solution was the same exact one from when I got line 187.

    I entered a physical location and accidentally selected the button “Configure Virtual Event”. Once, I did that, even though I didn’t enter any info for the virtual event section, it kicked out error 188. My only solution was to delete that event and re-enter it again (without clicking on the configure virtual event button).

    So, in summary you can’t have both. It has to be either a physical location or virtual event.

    I’m running:

    Yoast Version 16.0.2
    The Events Calendar Version 5.4.0.2
    The Events Calendar: Virtual Events Version 1.1.5

    I hope this helps anyone with the same problem.

    Hi guys,

    @mazedulislamkhan and @bordoni

    I’ve been having this issue for a while and just found this post (glad I am not the only one who is trying to resolve this:)

    The issue does not seem to be resolved yet. All my plug-ins are up-to-date.

    I am still having this error on my website:
    https://saluteenterprises.com.au/events/interdependency-management-webinar-20210430/

    The error is not really visible from a desk top view as it is hiding behind the menu bar.
    However, when you open the same page from a mobile version – it does look quite ugly & unprofessional.

    It does look to me as conflict between The Events Calendar & Yoast. (this error disappears when I am switching of Yoast).

    I really like and need both plug-ins. Would you please help to resolve this challenge?

    Thank you very much in advance!

    Thread Starter abuzon

    (@abuzon)

    @jlyasch I don’t remember what happened last time but the error is gone. I think I may have gone in and commented-out that line in the PHP file while awaiting an update, but I just check that file and lines 187 and 188 are there and totally intact and active.
    Check out the comment from Tinelle from just before yours, from @cocoabunny – she said it happened all because of one event that had both a location and was marked Virtual – said she had to delete the event and create anew but that it resolved the error.

    Thread Starter abuzon

    (@abuzon)

    @mazedulislamkhan @onlyincebu @maybellyne @devnihil
    As many others have pointed out, this issue is still not fixed over half a year later. @bordoni from Modern Tribe was nice enough to hop on here 6 months ago and give Yoast further instructions on what’s wrong. What are the chances that Yoast will ever get this fixed?

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘PHP Warning on Calendar, The Events Calendar’ is closed to new replies.