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

Human readable plugin information for `eventlist`

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.3.3
    • Administration, Events API
    • MOODLE_403_STABLE

      On the page `/report/eventlist/index.php`, it can be observed that the names of events that are part of Moodle `core` are not being translated. The previous code can be seen below:

       

      // line 316
      // report/eventlist/classes/list_generator.php
       
      // Human readable plugin information to go with the component.
      $pluginstring = explode('\\', $eventfullpath);
      if ($pluginstring[1] !== 'core') {
           $component = $eventdata[$eventfullpath]['component'];
          $manager = get_string_manager();
          if ($manager->string_exists('pluginname', $pluginstring[1])) {
              $eventdata[$eventfullpath]['component'] = \html_writer::span(get_string('pluginname', $pluginstring[1]));
          }
      }

       

      My suggested code to fix this issue is as follows:

      // Human readable plugin information to go with the component.
      $pluginstring = explode('\\', $eventfullpath);
      if (!str_contains($pluginstring[1], 'core')) { <- edited!
          $component = $eventdata[$eventfullpath]['component'];
          $manager = get_string_manager();
          if ($manager->string_exists('pluginname', $pluginstring[1])) {
              $eventdata[$eventfullpath]['component'] = \html_writer::span(get_string('pluginname', $pluginstring[1]));
          }
      } else { <- created
          $component = $pluginstring[1];
          if($component == 'core') $component = get_string('coresystem');
          if( strpos($component, 'core_') !== false) $component = get_string(str_replace('core_', '', $component), $component);
          $eventdata[$eventfullpath]['component'] = \html_writer::span($component);
      } 

       

       

       

            pholden Paul Holden
            moh.azadi Mohammad Azadi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

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