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

Function get_component_classes_in_namespace doesn't return the right class path as value

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Deferred
    • Icon: Minor Minor
    • None
    • 3.3.5, 3.4.2, 3.5
    • General
    • None
    • MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE

      When I was working in implements privacy for tool_mobile (MDL-61944) and I was checking an error in a general test, I can see a wrong class path in the return array with a print_object:

      print_object(core_component::get_component_classes_in_namespace('tool_mobile', ''));

      Result:

        ...
          [tool_mobile\privacy\provider] => Array
              (
                  [0] => tool_mobile\
              )
      ...
      

      When I was expecting this:

        ...
          [tool_mobile\privacy\provider] => Array
              (
                  [0] => tool_mobile\privacy
              )
      ...
      

      You can test it easly in this branch MDL-61944 editing lib/tests/component_test.php and add this print_object inside test_get_component_classes_int_namespace() and then launch:
      vendor/bin/phpunit --verbose core_component_testcase lib/tests/component_test.php

            Unassigned Unassigned
            cescobedo Carlos Escobedo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.