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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.9.4
    • 3.9.6, 3.10.3
    • Course

    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

            pholden Paul Holden
            dmitriim Dmitrii Metelkin
            Ilya Tregubov Ilya Tregubov
            Adrian Greeve Adrian Greeve
            CiBoT CiBoT
            Amaia Anabitarte, Carlos Escobedo, Laurent David, Mikel Martín Corrales, Sabina Abellan, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              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