Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-70924

Undefined property: stdClass::$ when calling API function get_courses()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.9.4
    • Fix Version/s: 3.9.6, 3.10.3
    • Component/s: Course
    • Labels:

      Description

      If you would call get_courses() with a limited number of fields like 

       $categorycourses = get_courses($categoryid, 'c.sortorder ASC', 'c.id');

      you would get following error:

      Undefined property: stdClass::$visible

      /var/www/project/respect/course/classes/category.php:695
      /var/www/project/respect/lib/datalib.php:652

        Attachments

          Activity

            People

            Assignee:
            pholden Paul Holden
            Reporter:
            dmitriim Dmitrii Metelkin
            Peer reviewer:
            Ilya Tregubov Ilya Tregubov
            Integrator:
            Adrian Greeve Adrian Greeve
            Tester:
            CiBoT CiBoT
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              25/Mar/21

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 10 minutes
                1h 10m