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

Calculated font sizes can cause an error in the Brickfield's css_text_has_contrast check

XMLWordPrintable

    • MOODLE_401_STABLE, MOODLE_402_STABLE, MOODLE_403_STABLE, MOODLE_404_STABLE
    • MOODLE_404_STABLE, MOODLE_405_STABLE
    • MDL-82429-401
    • MDL-82429-403
    • MDL-82429-404
    • MDL-82429-brickfield-calculated-fontsize
    • Hide
      Setup:

      To test this, the site needs to be registered with Brickfield. If you don't have a Brickfield account, you can register here. (Make sure your server can be accessed over the internet, e.g. using ngrok)

      • Activate your site with Brickfield in "Site administration / Plugins / Admin tools / Accessibility / Brickfield registration" by entering the API and Secret keys.
      • Enable analysis requests in "Site administration / Plugins / Admin tools / Accessibility / Accessibility toolkit settings"
      Test:
      1. Create a new course
      2. Turn editing mode on
      3. Create a label resource (Text and media area)
      4. Edit the resource using the editor's "View source" feature to insert the following HTML and save.

        <p dir="ltr" style="color: #6666ff; background-color: white; font-size: calc(0.90375rem + 0.045vw);">Calculated font-size</p>
        

      5. Add the "Accessibility review" block to the course.
      6. Click on the "Submit to Analysis" button to request that the course be analyzed by the accessibility toolkit.
      7. Manually run the scheduled task on the terminal: 

        php admin/cli/scheduled_task.php --execute="\\tool_brickfield\\task\\process_analysis_requests"
        

      8. Confirm that the scheduled task completed successfully with message similar to:

        Execute scheduled task: Process content analysis requests (tool_brickfield\task\process_analysis_requests)
        ... started 01:53:55. Current memory use 17.2 MB.
        ... used 8 dbqueries
        ... used 1.8360748291016 seconds
        Scheduled task complete: Process content analysis requests (tool_brickfield\task\process_analysis_requests)
        
        

      Show
      Setup: To test this, the site needs to be registered with Brickfield. If you don't have a Brickfield account,  you can register here . (Make sure your server can be accessed over the internet, e.g. using ngrok) Activate your site with Brickfield in "Site administration / Plugins / Admin tools / Accessibility / Brickfield registration" by entering the API and Secret keys. Enable analysis requests in "Site administration / Plugins / Admin tools / Accessibility / Accessibility toolkit settings" Test: Create a new course Turn editing mode on Create a label resource (Text and media area) Edit the resource using the editor's "View source" feature to insert the following HTML and save. < p dir = "ltr" style = "color: #6666ff; background-color: white; font-size: calc(0.90375rem + 0.045vw);" >Calculated font-size</ p > Add the "Accessibility review" block to the course. Click on the "Submit to Analysis" button to request that the course be analyzed by the accessibility toolkit. Manually run the scheduled task on the terminal:  php admin /cli/scheduled_task .php --execute= "\\tool_brickfield\\task\\process_analysis_requests" Confirm that the scheduled task completed successfully with message similar to: Execute scheduled task: Process content analysis requests (tool_brickfield\task\process_analysis_requests) ... started 01:53:55. Current memory use 17.2 MB. ... used 8 dbqueries ... used 1.8360748291016 seconds Scheduled task complete: Process content analysis requests (tool_brickfield\task\process_analysis_requests)

      HTML such as:
      <p style="color:#333333; background-color:#000000; font-size: calc(0.90375rem + 0.045vw);"> 

      can cause the css_text_has_contrast to fail resulting in the following error:

      Scheduled task failed: Process bulk batch accessibility checking (tool_brickfield\task\bulk_process_courses),Unsupported operand types: string * int

      This is due to 

      "\tool_brickfield\local\htmlchecker\common\brickfield_accessibility_color_test::get_fontsize()"

      not checking if substring is numeric

            x-iy David Adamson
            x-iy David Adamson
            Karen Holland Karen Holland
            Huong Nguyen Huong Nguyen
            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 - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours, 27 minutes
                4h 27m

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