Bounced Mail Cron returns Call_User_Func ACP error

Marcus

Well-known member
Do you know what causes this error, usually the addon works fine:
PHP:
XenForo_Model::create('BouncedMail_Model_BouncedMail')->updateBouncedUsers($bouncedMails);

PHP:
class BouncedMail_Model_BouncedMail extends XenForo_Model
{
  public function updateBouncedUsers($bouncedMails)
  {
  return $this->_getDb()->query('

PHP:
ErrorException: call_user_func() expects parameter 1 to be a valid callback, non-static method BouncedMail_BouncedMail::updateBouncedUsers() should not be called statically - library/XenForo/Model/Cron.php:356

#0 [internal function]: XenForo_Application::handlePhpError(2048, 'call_user_func(...', '/usr/local/lsws...', 356, Array)
#1 /library/XenForo/Model/Cron.php(356): call_user_func(Array, Array)
#2 /library/XenForo/Deferred/Cron.php(24): XenForo_Model_Cron->runEntry(Array)
#3 /library/XenForo/Model/Deferred.php(208): XenForo_Deferred_Cron->execute(Array, Array, 9.9999980926514, '')
#4 /library/XenForo/Model/Deferred.php(331): XenForo_Model_Deferred->runDeferred(Array, 9.9999980926514, '', false)
#5 /library/XenForo/Model/Deferred.php(284): XenForo_Model_Deferred->_runInternal(Array, NULL, '', false)
#6 /deferred.php(18): XenForo_Model_Deferred->run(false)
#7 {main}


array(3) {
  ["url"] => string(37) "deferred.php"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(4) {
    ["_xfRequestUri"] => string(21) "..."
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
    ["_xfResponseType"] => string(4) "json"
  }
}
 
The class names you posted don't match. The error doesn't include the model in the name. That would be the first fix I attempt.
 
The Class I call in the cron is
PHP:
class BouncedMail_BouncedMail
{
  public function updateBouncedUsers()
  {

The script does work, but I did get the error messages. I wonder why.
 
You've set BouncedMail_Model_BouncedMail::updateBouncedUsers as cronjob?;)

You need an extrascript, which calls
PHP:
XenForo_Model::create('BouncedMail_Model_BouncedMail')->updateBouncedUsers($bouncedMails);
 
Oh I have two scripts:

PHP:
class BouncedMail_BouncedMail // I call this script in the cron
{
  public function updateBouncedUsers()
  {
  /* magic */
  XenForo_Model::create('BouncedMail_Model_BouncedMail')->updateBouncedUsers($bouncedMails);

  }
}
PHP:
<?php

class BouncedMail_Model_BouncedMail extends XenForo_Model
{
  public function updateBouncedUsers($bouncedMails)
  {
  return /*query*/
   }
}
 
Back
Top Bottom