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

get_deprecated_capability_info does not check for component validity when loading capability info

XMLWordPrintable

      Notification M4.1

      Warning: file_exists(): open_basedir restriction in effect. File(/db/access.php) is not within the allowed path(s):

      Input received from hosting provider 

      1. The error does not occur consistently because it happens during the caching process. Once the data has been written to the cache, the error no longer appears.
      2. It does always occur when the function is called after all caches have been purged and debugging is set to maximum, but it does not consistently happen in every environment.
      3. It specifically originates from the function function get_deprecated_capability_info($capabilityname) in the /lib/accesslib.php.

      This function makes a call for each capability to:
      core_component::get_component_directory($cap['component'])
      If this returns null, you will receive this error message."

      The most recent core adjustment MDL-79697 but this does not seem to touch the specific code for the issue above. 

      Their conclusion was: 
      Add a check after defpath is set to ensure that it is different from /db/access.php, OR retrieve the component with the current call, and if it is null, skip this capability OR resolve the underlying issue.

      I found various other trackers and forum discussions around this subject, most recent:

      https://tracker.moodle.org/browse/MDL-72292

      (https://moodle.org/mod/forum/discuss.php?d=460897#p1852512)

            dobedobedoh Andrew Lyons
            gemguardian Gemma Lesterhuis
            Jake Dallimore Jake Dallimore
            Jun Pataleta Jun Pataleta
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 59 minutes
                59m

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