• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fixed [E_NOTICE] Trying to get property of non-object and Argument 2 passed ERROR

Affected version
2

reddit.

New member
#1
ONE ERROR

Code:
ErrorException: [E_NOTICE] Trying to get property of non-object src/XF/Repository/UserUpgrade.php:122



#0 src/XF/Repository/UserUpgrade.php(122): XF::handlePhpError(8, '[E_NOTICE] Tryi...', '/home/r/rangrou...', 122, Array)

#1 src/XF/Cron/CleanUp.php(169): XF\Repository\UserUpgrade->downgradeExpiredUpgrades()

#2 [internal function]: XF\Cron\CleanUp::runUserDowngrade(Object(XF\Entity\CronEntry))

#3 src/XF/Job/Cron.php(35): call_user_func(Array, Object(XF\Entity\CronEntry))

#4 src/XF/Job/Manager.php(241): XF\Job\Cron->run(8)

#5 src/XF/Job/Manager.php(187): XF\Job\Manager->runJobInternal(Array, 8)

#6 src/XF/Job/Manager.php(76): XF\Job\Manager->runJobEntry(Array, 8)

#7 job.php(15): XF\Job\Manager->runQueue(false, 8)

#8 {main}



array(4) {

  ["url"] => string(8) "/job.php"

  ["referrer"] => string(29) "https://mysite.com/members/"

  ["_GET"] => array(0) {

  }

  ["_POST"] => array(0) {

  }

}
TWO ERROR

Code:
TypeError: Argument 2 passed to XF\Service\User\Downgrade::__construct() must be an instance of XF\Entity\UserUpgrade, null given, called in /public_html/src/XF/Container.php on line 276 src/XF/Service/User/Downgrade.php:29

#0 src/XF/Container.php(276): XF\Service\User\Downgrade->__construct(Object(XF\Pub\App), NULL, Object(XF\Entity\User), Object(XF\Entity\UserUpgradeActive))

#1 src/XF/App.php(1318): XF\Container->createObject('XF\\Service\\User...', Array)

#2 src/XF/Container.php(228): XF\App->XF\{closure}('XF\\Service\\User...', Array, Object(XF\Container))

#3 src/XF/App.php(2456): XF\Container->create('service', 'XF:User\\Downgra...', Array)

#4 src/XF/Repository/UserUpgrade.php(132): XF\App->service('XF:User\\Downgra...', NULL, Object(XF\Entity\User), Object(XF\Entity\UserUpgradeActive))

#5 src/XF/Cron/CleanUp.php(169): XF\Repository\UserUpgrade->downgradeExpiredUpgrades()

#6 [internal function]: XF\Cron\CleanUp::runUserDowngrade(Object(XF\Entity\CronEntry))

#7 src/XF/Job/Cron.php(35): call_user_func(Array, Object(XF\Entity\CronEntry))

#8 src/XF/Job/Manager.php(241): XF\Job\Cron->run(8)

#9 src/XF/Job/Manager.php(187): XF\Job\Manager->runJobInternal(Array, 8)

#10 src/XF/Job/Manager.php(76): XF\Job\Manager->runJobEntry(Array, 8)

#11 job.php(15): XF\Job\Manager->runQueue(false, 8)

#12 {main}



array(4) {

  ["url"] => string(8) "/job.php"

  ["referrer"] => string(29) "https://mysite.com/members/"

  ["_GET"] => array(0) {

  }

  ["_POST"] => array(0) {

  }

}
 

Chris D

XenForo developer
Staff member
#2
I think this is a situation where you have active upgrades which relate to user upgrades that no longer exist.

We'll need to attempt to handle that more elegantly.
 
#5
The error cycle is an hour
Remove the user record from the table xf_user_upgrade_active. In past promotions it will not, but this is not critical.
Удалите запись о проблемном пользователе из таблицы xf_user_upgrade_active. В истекших повышениях его не будет, но это и не критично.