• 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

    • "A Microsoft spokesperson said that it had been in contact with the court since February “throughout the process that resulted in the disconnection of its sanctioned official from Microsoft services.” The spokesperson added that “at no point did Microsoft cease or suspend its services to the ICC.” Microsoft declined to comment further in response to questions regarding the exact process that led to Khan's email disconnection, and exactly what it meant by “disconnection.” The ICC declined to comment. However, German business magazine WirtschaftsWoche reported Tuesday that Microsoft's lawyers have now reached the view that it merely provides a technical platform and that its customers decide whether to give their employees access to its services. Microsoft would no longer intervene in scenarios similar to the ICC case, WirtschaftsWoche wrote." Source: https://www.politico.eu/articl...ump-tech-icc-amazon-google/ So while they haven't targeted the ICC, they seem to have targeted a sanctioned individual and cut that individual off from their services. At least I cannot read the statement from their spokesperson in any other way. It can however be understood as they did this on behalf of the ICC, which would line up with Smith's statements that they never cut off services to the ICC. But I don't know if there is any confirmed sources back that up.
    • Oof, that's a pretty glaring issue. They seem to be consistently proving that they don't do the necessary QA before sending things out.
    • They have removed th way to download directly the iso of windows from rufus ? i have tried the version 4.9, the button selection isn't a select list to choose download
  • Recent Achievements

    • Week One Done
      patrickft456 earned a badge
      Week One Done
    • One Month Later
      patrickft456 earned a badge
      One Month Later
    • One Month Later
      Jdoe25 earned a badge
      One Month Later
    • Explorer
      Legend20 went up a rank
      Explorer
    • One Month Later
      jezzzy earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      617
    2. 2
      ATLien_0
      281
    3. 3
      +FloatingFatMan
      174
    4. 4
      Michael Scrip
      153
    5. 5
      Steven P.
      125
  • Tell a friend

    Love Neowin? Tell a friend!