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

Contentbank refers to invalid image URLs for icons

XMLWordPrintable

    • MOODLE_403_STABLE
    • MOODLE_403_STABLE
    • MDL-79840-403
    • Hide
      1. Manually edit contentbank/contenttype/h5p/classes/contenttype.php:

        -    public function get_icon(\core_contentbank\content $content): string {
        +    public function __get_icon(\core_contentbank\content $content): string {
        

        • This simulates a contenttype plugin not overriding the base get_icon implementation
      2. Log in as admin
      3. Manually navigate to <WWWROOT>/contentbank/index.php
      4. Press Upload
      5. Upload greeting-card.h5p and save changes
      6. Press Exit
      7. Confirm presence of "unknown" (question mark) icon next to the greeting-card content you just uploaded
      Show
      Manually edit contentbank/contenttype/h5p/classes/contenttype.php : - public function get_icon(\core_contentbank\content $content): string { + public function __get_icon(\core_contentbank\content $content): string { This simulates a contenttype plugin not overriding the base get_icon implementation Log in as admin Manually navigate to <WWWROOT>/contentbank/index.php Press Upload Upload greeting-card.h5p and save changes Press Exit Confirm presence of "unknown" (question mark) icon next to the greeting-card content you just uploaded

      This is the same problem as reported previously in MDL-79534 (caused by removal of size specific icons originally in MDL-78884)

      1. The base implementation of get_icon() refers to invalid image
      2. The "testable" contenttype also refers to invalid image

      In the second case, remove that implementation from the "testable" class because it's only actually used to be tested. We are testing a test method, which is silly The testcase can just assert the base implementation

      According to the following naive grep, these are the only remaining cases referring to images using size-specific version:

      $ git grep "image_url(.*[0-9]'" -- '*.php'
      

        1. greeting-card.h5p
          4 kB
          Paul Holden
        2. MDL-79840.png
          284 kB
          Ron Carl Alfon Yu

            pholden Paul Holden
            pholden Paul Holden
            Carlos Escobedo Carlos Escobedo
            Amaia Anabitarte Amaia Anabitarte
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            9 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, 40 minutes
                1h 40m

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