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

And the following "activities" exist: step gives misleading error messages

XMLWordPrintable

      When that was first implemented in MDL-40672, 10 years ago,

          And the following "activities" exist:
      

      had this error 'handling' applied:

              // Custom exception.
              try {
                  $this->datagenerator->create_module($activityname, $data, $cmoptions);
              } catch (coding_exception $e) {
                  throw new Exception('\'' . $activityname . '\' activity can not be added using this step,' .
                          ' use the step \'I add a "ACTIVITY_OR_RESOURCE_NAME_STRING" to section "SECTION_NUMBER"\' instead');
              }
      

      In all those years, I have never seen that message until today, and today it was just misleading.

      In this case, the real error was

      coding_exception: Coding error detected, it must be fixed by a programmer: Invalid availability structure (unknown ->op) in C:\Users\tjh238\workspace\moodle_head\availability\classes\tree.php:152

      which came from my attempts to implement this: https://github.com/timhunt/moodle/commit/MDL-79798#diff-cf8371d9243575cafbfb3cd7ef9dd62ee698f139a0c3419ab740185982561385R14.

      I think that, in 2023, that catch is not useful advice, so I propose we just remove it.

            timhunt Tim Hunt
            timhunt Tim Hunt
            Anupama Sarjoshi Anupama Sarjoshi
            Simey Lameze Simey Lameze
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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

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