Best practice forum (Archived)

Problem assigning role in program context

 
Richard Jones
Problem assigning role in program context
על ידי Richard Jones בתאריך 21/10/2013, 14:24
 

I am administering a system where some roles have been modified already.  When attempting to assign a role via the program settings screen, clicking Users | permissions | assigned roles throws an error "Can not find data record in database table course."

Apparently, the administrator was able to do this in previous versions.

Any ideas as to where I should look to find the problem?

Thanks

Richard

 

me
Re: Problem assigning role in program context
על ידי George Angus בתאריך 21/10/2013, 18:21
קבוצה Totara

Hi RIchard,

Someone will be in touch with you shortly about this.

regards,

George.

Richard Jones
Re: Problem assigning role in program context
על ידי Richard Jones בתאריך 23/10/2013, 19:52
 

Hi George

Could use the help.

Thanks

Richard

me
Re: Problem assigning role in program context
על ידי George Angus בתאריך 23/10/2013, 20:21
קבוצה Totara

Hi Richard,

Can you tell me with the version you are using, where you are going to assign the roles & what you did exactly to get the error?

Thanks,

George.

 

Richard Jones
Re: Problem assigning role in program context
על ידי Richard Jones בתאריך 24/10/2013, 12:15
 

Hi George

There a couple of things that seem strange.  Checking the permissions gives the record not found error:

Also there are some roles with a triple question mark (which suggests to me there might be sone code incorrect or missing)?

Thanks for any suggestions you can make.

Richard

me
Re: Problem assigning role in program context
על ידי George Angus בתאריך 24/10/2013, 14:37
קבוצה Totara

Hi Richard,

Could you supply a screenshot with the debugging enabled? Also what version are you on?

regards,

George.

Richard Jones
Re: Problem assigning role in program context
על ידי Richard Jones בתאריך 24/10/2013, 14:57
 

Here is the debug info:

Debug info: SELECT id,category FROM {course} WHERE id = ?
[array (
0 => '71',
)]
Error code: invalidrecord
Stack trace:
  • line 1365 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
  • line 1341 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
  • line 6779 of /lib/accesslib.php: call to moodle_database->get_record()
  • line 881 of /lib/pagelib.php: call to context_course::instance()
  • line 2802 of /lib/moodlelib.php: call to moodle_page->set_course()
  • line 57 of /admin/roles/assign.php: call to require_login()
Can not find data record in database table course.
Debug info: SELECT id,category FROM {course} WHERE id = ?
[array (
0 => '71',
)]
Error code: invalidrecord
Stack trace:
  • line 1365 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
  • line 1341 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
  • line 6779 of /lib/accesslib.php: call to moodle_database->get_record()
  • line 3959 of /lib/navigationlib.php: call to context_course::instance()
  • line 3897 of /lib/navigationlib.php: call to settings_navigation->generate_user_settings()
  • line 3248 of /lib/navigationlib.php: call to settings_navigation->load_user_settings()
  • line 706 of /lib/pagelib.php: call to settings_navigation->initialise()
  • line 730 of /lib/pagelib.php: call to moodle_page->magic_get_settingsnav()
  • line 133 of /blocks/settings/block_settings.php: call to moodle_page->__get()
  • line 284 of /blocks/moodleblock.class.php: call to block_settings->get_content()
  • line 232 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
  • line 953 of /lib/blocklib.php: call to block_base->get_content_for_output()
  • line 1005 of /lib/blocklib.php: call to block_manager->create_block_contents()
  • line 353 of /lib/blocklib.php: call to block_manager->ensure_content_created()
  • line 34 of /theme/standardtotara/layout/general.php: call to block_manager->region_has_content()
  • line 806 of /lib/outputrenderers.php: call to include()
  • line 734 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
  • line 2364 of /lib/outputrenderers.php: call to core_renderer->header()
  • line ? of unknownfile: call to core_renderer->fatal_error()
  • line 1455 of /lib/setuplib.php: call to call_user_func_array()
  • line 375 of /lib/setuplib.php: call to bootstrap_renderer->__call()
  • line 375 of /lib/setuplib.php: call to bootstrap_renderer->fatal_error()
  • line ? of unknownfile: call to default_exception_handler()

We are using Version 2.4.0 (Build: 20130430.00)

Thanks

Richard

Oleg Demeshev
Re: Problem assigning role in program context
על ידי Oleg Demeshev בתאריך 29/10/2013, 17:21
קבוצה Totara

Hi Richard,

I can't reproduce your problem but I'm using Totara 2.4.13 version and it is possible that the issue is fixed with the new versions. Is it possible to update your system?

Regards

Oleg

Richard Jones
Re: Problem assigning role in program context
על ידי Richard Jones בתאריך 24/10/2013, 14:48
 

Hi George

I would also like to know what happened between 1.9 and 2.0 in Totara roles - I know there were significant changes to the concept of context in the Moodle world (such that roles became unsupported in some contexts).  Did Totara also add the Manager (as in people/staff manager role to be applied in the User context, as opposed to the traditional Moodle Manager (typically applied in system or category contexts) at this time.  If so, how was the 1.9 Manager role affected - was it renamed?

Thanks if you can help, it might shed some light on what happened in our system.

Richard

 

Simon Coggins
Re: Problem assigning role in program context
על ידי Simon Coggins בתאריך 24/10/2013, 15:09
קבוצה Totara

Hi Richard,

Regarding the Manager role in 2.0. What happened was, in Moodle 1.9 there was no manager role. In Totara 1.1 (based on Moodle 1.9) we added a 'manager' role to represent a staff member's manager. Then in Moodle 2.0 they added a 'manager' role which meant a user who was managing the site (e.g an administrator).

Because this would have led to conflict issues we renamed our role (old shortname: manager, old name: Manager) to "Staff Manager" (new shortname: staffmanager). We also changed the description of the moodle 'manager' role to "Site Manager", while keeping its shortname 'manager' as that is used in lots of places in Moodle.

When you assign someone as the manager in Totara 2+ we automatically assign the "Staff manager" role in the context of the staff member.

Hope that helps,

Simon

 

Richard Jones
Re: Problem assigning role in program context
על ידי Richard Jones בתאריך 24/10/2013, 15:41
 

Gotcha.  Thanks.

Oleg Demeshev
Re: Problem assigning role in program context
על ידי Oleg Demeshev בתאריך 29/10/2013, 19:10
קבוצה Totara

Hi Richard,

We finally found the problem and we are going to release a patch with the next version, which is 2.4.14/12 November 2013.

Regards

Oleg

Richard Jones
Re: Problem assigning role in program context
על ידי Richard Jones בתאריך 30/10/2013, 11:22
 

Thanks Oleg.

פרסום זה הוסר
18/11/2013, 21:28
פרסום זה הוסר ואינו זמין יותר.