Fixed Error with User criteria user group options

Siropu

Well-known member
Affected version
2.0.9
When using user criteria option "User is a member of any of the selected user groups:" or "User is NOT a member of any of the selected user groups:" with no user group selected you get the following error on the front-end:
An exception occurred: [ErrorException] [E_NOTICE] Undefined index: user_group_ids in src/XF/Criteria/User.php on line 243
 
I am getting the same error :

Code:
[E_NOTICE] Undefined index: user_group_ids src/XF/Criteria/User.php:243

Code:
#0 src/XF/Criteria/User.php(243): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/home2/bekarz...', 243, Array)
#1 src/XF/Criteria/AbstractCriteria.php(53): XF\Criteria\User->_matchUserGroups(Array, Object(XenConcept\UsernameChange\XF\Entity\User))
#2 src/XF/Repository/Trophy.php(68): XF\Criteria\AbstractCriteria->isMatched(Object(XenConcept\UsernameChange\XF\Entity\User))
#3 src/XF/Cron/Trophy.php(38): XF\Repository\Trophy->updateTrophiesForUser(Object(XenConcept\UsernameChange\XF\Entity\User), Array, Object(XF\Mvc\Entity\ArrayCollection))
#4 [internal function]: XF\Cron\Trophy::runTrophyCheck(Object(XF\Entity\CronEntry))
#5 src/XF/Job/Cron.php(35): call_user_func(Array, Object(XF\Entity\CronEntry))
#6 src/XF/Job/Manager.php(241): XF\Job\Cron->run(7.9999990463257)
#7 src/XF/Job/Manager.php(187): XF\Job\Manager->runJobInternal(Array, 7.9999990463257)
#8 src/XF/Job/Manager.php(76): XF\Job\Manager->runJobEntry(Array, 7.9999990463257)
#9 job.php(15): XF\Job\Manager->runQueue(false, 8)
#10 {main}

Code:
array(4) {
  ["url"] => string(8) "/job.php"
  ["referrer"] => string(29) "http://namedomain.net/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}

Do you know from where the error comes ? thank you!
 
It comes from the User criteria in Notices or User promotions when checking "User is a member of any of the selected user groups:" or "User is NOT a member of any of the selected user groups:" without selecting any user groups.

If you want it to apply to any user group, you don't have to check these options.
 
It comes from the User criteria in Notices or User promotions when checking "User is a member of any of the selected user groups:" or "User is NOT a member of any of the selected user groups:" without selecting any user groups.

If you want it to apply to any user group, you don't have to check these options.
Thanks!
 
Back
Top Bottom