Moodle
  1. Moodle
  2. MDL-30543

navigation lib generating php warnings in messaging

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.2
    • Component/s: Messages, Navigation
    • Labels:
    • Database:
      Any
    • Testing Instructions:
      Hide
      1. Log in as an admin
      2. Browse to a course (any course will do)
      3. In the settings block expand `My profile settings` and click `Messaging`
      4. Make sure the URL has a course param on it
      5. Make sure you don't get a fatal error
      6. Repeat as a student (will need to be a course you are enrolled in)
      Show
      Log in as an admin Browse to a course (any course will do) In the settings block expand `My profile settings` and click `Messaging` Make sure the URL has a course param on it Make sure you don't get a fatal error Repeat as a student (will need to be a course you are enrolled in)
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE
    • Pull Master Branch:
      wip-MDL-30543-m22
    • Rank:
      33257

      Description

      Originally discovered while testing MDL-30260. If you go to My profile settings > messaging from the front page all is well. If you go to a course page then access My profile settings > messaging you get a php warning.

      Ankit reported this error message

      ( ! ) Notice: Undefined property: stdClass::$format in H:\wamp\www\repo2\master\moodle\lib\navigationlib.php on line 1555
      Call Stack
      #	Time	Memory	Function	Location
      1	0.0011	438912	{main}( )	..\edit.php:0
      2	0.2993	17618816	global_navigation->find( )	..\edit.php:78
      3	0.2993	17618816	global_navigation->initialise( )	..\navigationlib.php:2422
      4	0.3703	22540192	global_navigation->load_course_sections( )	..\navigationlib.php:1239
      
      ( ! ) Notice: Undefined property: stdClass::$format in H:\wamp\www\repo2\master\moodle\lib\navigationlib.php on line 1556
      Call Stack
      #	Time	Memory	Function	Location
      1	0.0011	438912	{main}( )	..\edit.php:0
      2	0.2993	17618816	global_navigation->find( )	..\edit.php:78
      3	0.2993	17618816	global_navigation->initialise( )	..\navigationlib.php:2422
      4	0.3703	22540192	global_navigation->load_course_sections( )	..\navigationlib.php:1239
      Coding problem - missing course modinfo property in get_fast_modinfo() call
      line 1098 of \lib\modinfolib.php: call to debugging()
      line 1584 of \lib\navigationlib.php: call to get_fast_modinfo()
      line 1645 of \lib\navigationlib.php: call to global_navigation->generate_sections_and_activities()
      line 1567 of \lib\navigationlib.php: call to global_navigation->load_generic_course_sections()
      line 1239 of \lib\navigationlib.php: call to global_navigation->load_course_sections()
      line 2422 of \lib\navigationlib.php: call to global_navigation->initialise()
      line 78 of \message\edit.php: call to global_navigation->find()
      
      ( ! ) Notice: Undefined property: stdClass::$numsections in H:\wamp\www\repo2\master\moodle\lib\navigationlib.php on line 1585
      Call Stack
      #	Time	Memory	Function	Location
      1	0.0011	438912	{main}( )	..\edit.php:0
      2	0.2993	17618816	global_navigation->find( )	..\edit.php:78
      3	0.2993	17618816	global_navigation->initialise( )	..\navigationlib.php:2422
      4	0.3703	22540192	global_navigation->load_course_sections( )	..\navigationlib.php:1239
      5	0.3709	22540824	global_navigation->load_generic_course_sections( )	..\navigationlib.php:1567
      6	0.3709	22540872	global_navigation->generate_sections_and_activities( )	..\navigationlib.php:1645
      

      As a student I am getting

      Notice: Undefined property: stdClass::$format in /home/andrew/Desktop/code/moodle/int/master/lib/navigationlib.php on line 1555 Notice: Undefined property: stdClass::$format in /home/andrew/Desktop/code/moodle/int/master/lib/navigationlib.php on line 1556 
      

      As admin I get

      Coding problem - missing course modinfo property in get_fast_modinfo() call
      
          line 1098 of /lib/modinfolib.php: call to debugging()
          line 983 of /lib/completionlib.php: call to get_fast_modinfo()
          line 47 of /report/progress/lib.php: call to completion_info->get_activities()
          line 2258 of /lib/navigationlib.php: call to report_progress_extend_navigation_course()
          line 1238 of /lib/navigationlib.php: call to global_navigation->add_course_essentials()
          line 2418 of /lib/navigationlib.php: call to global_navigation->initialise()
          line 78 of /message/edit.php: call to global_navigation->find()
      
      Notice: Undefined property: stdClass::$format in /home/andrew/Desktop/code/moodle/int/master/lib/navigationlib.php on line 1555 Notice: Undefined property: stdClass::$format in /home/andrew/Desktop/code/moodle/int/master/lib/navigationlib.php on line 1556 
      

        Issue Links

          Activity

          Hide
          Michael de Raadt added a comment -

          I'm not able to replicate those errors as an admin or as a student.

          Show
          Michael de Raadt added a comment - I'm not able to replicate those errors as an admin or as a student.
          Hide
          Sam Hemelryk added a comment -

          This is a regression caused by MDL-30378.

          Show
          Sam Hemelryk added a comment - This is a regression caused by MDL-30378 .
          Hide
          Sam Hemelryk added a comment -

          Up for peer-review now.

          Would be great to sneak this into 2.2 as it is a regression of an issue that was integrated yesterday however I don't know what the chance of that are. I will bring this to Eloy's attention.

          Cheers
          Sam

          Show
          Sam Hemelryk added a comment - Up for peer-review now. Would be great to sneak this into 2.2 as it is a regression of an issue that was integrated yesterday however I don't know what the chance of that are. I will bring this to Eloy's attention. Cheers Sam
          Hide
          Sam Hemelryk added a comment -

          Have brought this to Eloy's attention and he has OK'd it for late entry.
          Putting it up for integration now.

          Show
          Sam Hemelryk added a comment - Have brought this to Eloy's attention and he has OK'd it for late entry. Putting it up for integration now.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          +1 it's clearly one regression no detected by one idiot integrator (me).

          Show
          Eloy Lafuente (stronk7) added a comment - +1 it's clearly one regression no detected by one idiot integrator (me).
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Integrated, thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Integrated, thanks!
          Hide
          Andrew Davis added a comment -

          Looks good

          Show
          Andrew Davis added a comment - Looks good
          Hide
          Eloy Lafuente (stronk7) added a comment -

          And this is now part of the new, just created 22_STABLE and v2.2.0 release, yay! Thanks!

          Closing

          Show
          Eloy Lafuente (stronk7) added a comment - And this is now part of the new, just created 22_STABLE and v2.2.0 release, yay! Thanks! Closing

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: