- Issue created by @flocondetoile
- Status changed to Needs review
over 1 year ago 12:37pm 17 August 2023 - π¨π¦Canada joelseguin Ontario, Canada
I can confirm that on Drupal 9.5.10 the patch worked perfectly for me. I added several users to a training and was getting a WSOD when visiting the catalog page. Patch applied, no errors in the even log and users can now access the page as expected.
- Status changed to RTBC
5 months ago 4:32pm 29 October 2024 - πΊπΈUnited States scott.allison
I'm also having the same issue. Removing the assertion obviously removes the AssertionError, but I'd like to know more about why the assertion was added in the first place.
According to PHP docs, "assertions should be used as a debugging feature only."
Should a condition be added to return NULL if $result is not numeric or is empty? Or is it safe to remove the assertion completely? It doesn't seem to cause any issues in my testing, so this patch can be RTBC if a maintainer doesn't have any concerns.
- π³πΏNew Zealand sphism
#2 worked for me, but agree that returning NULL might upset other code
- π³π¬Nigeria chike Nigeria
We have been testing our site on live server with multiple student accounts and never encountered this issue. Then I decided to do some work in local development and while testing I tried logging in as a student and this issue appeared:
The website encountered an unexpected error. Try again later. AssertionError: assert(is_numeric($result) && !empty($result)) in assert() (line 743 of modules/contrib/opigno_module/src/Entity/OpignoModule.php).
I applied this patch to solve the issue.
Thanks.
- πΊπΈUnited States jeremy at monarch digital
This issue looks like mine:
AssertionError: assert(is_numeric($result) && !empty($result)) in assert() (line 746 of modules/contrib/opigno_module/src/Entity/OpignoModule.php). Drupal\opigno_module\Entity\OpignoModule->getGroupIdCurrentTraining() (Line: 435) Drupal\opigno_module\Entity\OpignoModule->getModuleAttempts() (Line: 2875) opigno_learning_path_get_module_activities() (Line: 3000) opigno_learning_path_get_step_progress() (Line: 3052) opigno_learning_path_get_step_status() (Line: 107) Drupal\opigno_learning_path\Progress->getProgress() (Line: 166)
Rather than remove the assertion mentioned, I added a group_id to this call:
opigno_learning_path_get_step_status() (Line: 107)