• 0

[php] Fatal error: Call to undefined method stdClass::set()


Question

i am creating a plugin for wordpress and keep getting an error i know nothing about, what does this error mean?

Fatal error: Call to undefined method stdClass::set() in/home/uplift/public_html/forum/includes/functions.php on line 7345

within my plugin it pulls vbulletin forums global.php, which in turn will reference functions.php

if (!defined('LOCATION_BYPASS'))

{
			$vbulletin->session->set('inforum', (!empty($foruminfo['forumid']) ? $foruminfo['forumid'] : 0));
			$vbulletin->session->set('inthread', (!empty($threadinfo['threadid']) ? $threadinfo['threadid'] : 0));
			$vbulletin->session->set('incalendar', (!empty($calendarinfo['calendarid']) ? $calendarinfo['calendarid'] : 0));
}

this line is 7345:

$vbulletin->session->set('inforum', (!empty($foruminfo['forumid']) ? $foruminfo['forumid'] : 0))

can anyone shed any light?

One minute it will work, then it will show this error, logging out of forum and in again fixes it then it breaks again after a while

1 answer to this question

Recommended Posts

  • 0

This error usually means the variable/property you're accessing (in this case $vbulletin->session) isn't set, but because you're accessing it as an object, i.e. trying to call methods / access properties on it, PHP converts it to an instance of stdClass which is PHP's standard generic object class.

I don't know VBulletin, but my guess is that when you're referencing $vbulletin->session, the session hasn't actually be initialised yet and you either need to do something to initialise it, or move your code somewhere else, so that when you come to access the session property, the session itself has been successfully initialised.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • From a quick Google it seems 6GHz is optional on 802.11be. Ubiquiti has one, Unifi U7 Lite.
    • Disagreed, I feel it’s going somewhere and his role served a purpose - and moreover with maybe what 10 mins of screen time - he had a bit of character development also.
    • This is the Superman film I had been waiting for. The tone was fine, yes a little more “fun” than previous outings but a lot of that came from supporting characters. Krypto was well handled, and somehow managed to not be an annoying distraction and actually a valid part of the story. Hoult was GREAT as Luthor. Genuinely so happy that this wasn’t crap. I personally enjoyed Superman Returns, despite its flaws (tried too much to hide behind the older movies, had no real fight to Superman). I enjoyed the Man Of Steel movies despite their flaws (totally that is NOT Superman). But this - this is the film I had wanted. In the UK we are far more reserved in cinemas than Americans. It’s rare that there is the whooping and hollering that we have seen from videos of US theatres, so when I say that the audience clapped at the end of this - it’s quite a big deal. As for all this “Superman has gone woke” BS - he is freaking Superman and if at any point in that movie you found yourself pooh-pooing his actions, you are just - you’re aligning your thinking with the problems and not the solutions. I adore how the movie addressed the modern world through thinly veiled allegory (Israel, online bots, perceptions of people, how they change on a dime) - that is maybe one of the greatest strengths of  comics, they rarely pull punches with that sort of thing, and look, THIS IS SUPERMAN, he’s meant to be the global boyscout and that is a strength and where he falls down sometimes, that’s just who he is and who he is meant to be. I also am glad there was no reference to the worldwide joke that is “Truth, Justice and the American way”. I can understand the comment suggesting this film was a little too “fun” or “whimsical”, but I’d urge a rewatch of the Donner Superman. It was very much a flawed masterpiece and its subsequent sequel had too many jokes that didn’t land. While there was a lot of James Gunn in this movie, I feel he pulled it back significantly, it wasn’t Guardians and moreover a lot of the fun came from supporting roles.
    • People do it everywhere. Should be legal to be allowed to bitch slap people who put their phone on speaker in public places
  • Recent Achievements

    • One Month Later
      Ricky Chan earned a badge
      One Month Later
    • First Post
      leoniDAM earned a badge
      First Post
    • Reacting Well
      Ian_ earned a badge
      Reacting Well
    • One Month Later
      Ian_ earned a badge
      One Month Later
    • Dedicated
      MacDaddyAz earned a badge
      Dedicated
  • Popular Contributors

    1. 1
      +primortal
      504
    2. 2
      ATLien_0
      207
    3. 3
      Michael Scrip
      205
    4. 4
      Xenon
      141
    5. 5
      +FloatingFatMan
      115
  • Tell a friend

    Love Neowin? Tell a friend!