Error Cannot access private property cm_info::$uservisible

Error Cannot access private property cm_info::$uservisible

by mohamed hassan -
Number of replies: 8

After I upgraded my moodle from 3.8.3 to 3.10 I encountered problem seeing the dashboard and sone courses categories with the following error 

Exception - Cannot access private property cm_info::$uservisible

Any help please ? 


Average of ratings: -
In reply to mohamed hassan

Re: Error Cannot access private property cm_info::$uservisible

by mohamed hassan -
I found that this message is showing at the place of courses at front page . it is only show to site administrators but not for other users
In reply to mohamed hassan

Re: Error Cannot access private property cm_info::$uservisible

by Ricardo Caiado -
Picture of Particularly helpful Moodlers
Same problem here.

Moodle 3.8.5+
In reply to mohamed hassan

Re: Error Cannot access private property cm_info::$uservisible

by tehila openapp -
hi

i have this error to all user in all site:

Exception - Cannot access private property cm_info::$uservisible
Debug info:
Error code: generalexceptionmessage
Stack trace:

line 102 of /filter/activitynames/filter.php: Error thrown
line 78 of /filter/activitynames/filter.php: call to filter_activitynames->get_activity_list()
line 42 of /filter/activitynames/filter.php: call to filter_activitynames->get_cached_activity_list()
line 176 of /lib/filterlib.php: call to filter_activitynames->filter()
line 232 of /lib/filterlib.php: call to filter_manager->apply_filter_chain()
line 1488 of /lib/weblib.php: call to filter_manager->filter_string()
line 115 of /availability/condition/group/classes/condition.php: call to format_string()
line 159 of /availability/classes/condition.php: call to availability_group\condition->get_description()
line 526 of /availability/classes/tree.php: call to core_availability\condition->get_standalone_description()
line 476 of /availability/classes/tree.php: call to core_availability\tree->get_full_information_recursive()
line 216 of /availability/classes/info.php: call to core_availability\tree->get_result_information()
line 1892 of /lib/modinfolib.php: call to core_availability\info->is_available()
line 1921 of /lib/modinfolib.php: call to cm_info->obtain_dynamic_data()
line 1234 of /lib/modinfolib.php: call to cm_info->get_user_visible()
line 102 of /filter/activitynames/filter.php: call to cm_info->__get()
line 78 of /filter/activitynames/filter.php: call to filter_activitynames->get_activity_list()
line 42 of /filter/activitynames/filter.php: call to filter_activitynames->get_cached_activity_list()
line 176 of /lib/filterlib.php: call to filter_activitynames->filter()
line 232 of /lib/filterlib.php: call to filter_manager->apply_filter_chain()
line 1488 of /lib/weblib.php: call to filter_manager->filter_string()
line 2752 of /course/renderer.php: call to format_string()
line 1117 of /course/renderer.php: call to coursecat_helper->get_course_formatted_name()
line 1191 of /course/renderer.php: call to core_course_renderer->course_name()
line 1419 of /course/renderer.php: call to core_course_renderer->coursecat_coursebox()
line 1554 of /course/renderer.php: call to core_course_renderer->coursecat_courses()
line 1647 of /course/renderer.php: call to core_course_renderer->coursecat_category_content()
line 1780 of /course/renderer.php: call to core_course_renderer->coursecat_tree()
line 66 of /course/index.php: call to core_course_renderer->course_category()

version 3.97

tehila
In reply to tehila openapp

Re: Error Cannot access private property cm_info::$uservisible

by Daniel Becker -

Hi,

is there any solution yet? I got the same error when upgrading to 3.11.1. In admin mode the error pops up only in the dashboard, for users it breaks the full site.

The debugging code is similar to tehilas (only number of lines changes):

Error: Cannot access private property cm_info::$uservisible
Debug info:
Error code: generalexceptionmessage
Stack trace:
  • line 102 of /filter/activitynames/filter.php: Error thrown
  • line 78 of /filter/activitynames/filter.php: call to filter_activitynames->get_activity_list()
  • line 42 of /filter/activitynames/filter.php: call to filter_activitynames->get_cached_activity_list()
  • line 176 of /lib/filterlib.php: call to filter_activitynames->filter()
  • line 232 of /lib/filterlib.php: call to filter_manager->apply_filter_chain()
  • line 1488 of /lib/weblib.php: call to filter_manager->filter_string()
  • line 1487 of /lib/grade/grade_item.php: call to format_string()
  • line 192 of /availability/condition/grade/classes/condition.php: call to grade_item->get_name()
  • line 145 of /availability/condition/grade/classes/condition.php: call to availability_grade\condition::get_cached_grade_name()
  • line 159 of /availability/classes/condition.php: call to availability_grade\condition->get_description()
  • line 526 of /availability/classes/tree.php: call to core_availability\condition->get_standalone_description()
  • line 476 of /availability/classes/tree.php: call to core_availability\tree->get_full_information_recursive()
  • line 216 of /availability/classes/info.php: call to core_availability\tree->get_result_information()
  • line 1923 of /lib/modinfolib.php: call to core_availability\info->is_available()
  • line 1957 of /lib/modinfolib.php: call to cm_info->obtain_dynamic_data()
  • line 1235 of /lib/modinfolib.php: call to cm_info->get_user_visible()
  • line 102 of /filter/activitynames/filter.php: call to cm_info->__get()
  • line 78 of /filter/activitynames/filter.php: call to filter_activitynames->get_activity_list()
  • line 42 of /filter/activitynames/filter.php: call to filter_activitynames->get_cached_activity_list()
  • line 176 of /lib/filterlib.php: call to filter_activitynames->filter()
  • line 232 of /lib/filterlib.php: call to filter_manager->apply_filter_chain()
  • line 1488 of /lib/weblib.php: call to filter_manager->filter_string()
  • line 285 of /calendar/renderer.php: call to format_string()
  • line 173 of /calendar/classes/external/calendar_upcoming_exporter.php: call to core_calendar_renderer->course_filter_selector()
  • line 142 of /calendar/classes/external/calendar_upcoming_exporter.php: call to core_calendar\external\calendar_upcoming_exporter->get_course_filter_selector()
  • line 125 of /lib/classes/external/exporter.php: call to core_calendar\external\calendar_upcoming_exporter->get_other_values()
  • line 3508 of /calendar/lib.php: call to core\external\exporter->export()
  • line 53 of /blocks/calendar_upcoming/block_calendar_upcoming.php: call to calendar_get_view()
  • line 341 of /blocks/moodleblock.class.php: call to block_calendar_upcoming->get_content()
  • line 235 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
  • line 1181 of /lib/blocklib.php: call to block_base->get_content_for_output()
  • line 1239 of /lib/blocklib.php: call to block_manager->create_block_contents()
  • line 374 of /lib/blocklib.php: call to block_manager->ensure_content_created()
  • line 3980 of /lib/outputrenderers.php: call to block_manager->region_has_content()
  • line 43 of /theme/trema/layout/mydashboard.php: call to core_renderer->blocks()
  • line 1396 of /lib/outputrenderers.php: call to include()
  • line 1326 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
  • line 165 of /my/index.php: call to core_renderer->header()
Daniel

In reply to mohamed hassan

Re: Error Cannot access private property cm_info::$uservisible

by tehila openapp -
hi

i found solution, minor change code core:
in filter/activitynames/filter.php line 103, in condition instead of $cm->uservisible write $cm->get_user_visible(),

tehila
Average of ratings: Useful (2)
In reply to tehila openapp

Re: Error Cannot access private property cm_info::$uservisible

by Daniel Becker -

works like charm. Thanks a lot!

Cheers Daniel

In reply to mohamed hassan

Re: Error Cannot access private property cm_info::$uservisible

by Richard van Iwaarden -
Picture of Particularly helpful Moodlers
We have some users getting this message using Global Search.

Do you guys have php-fpm? We switched to this and now the errors have started
In reply to Richard van Iwaarden

Re: Error Cannot access private property cm_info::$uservisible

by Ricardo Caiado -
Picture of Particularly helpful Moodlers
Yes, I´m using PHP-FPM.