Skip to content

Inconsistent default value in "Activity Type" filter on Edit Dates report due to alphabetical sorting #71

Description

@andreumarti

Description:

Current behavior:
When landing on the report_editdates page, the "Activity Type" dropdown filter automatically selects the first item in the list based on alphabetical order.

However, the report initially displays all activities by default, regardless of what the dropdown shows. This creates a mismatch between the UI filter state and the actual data displayed.

The Localization Issue:

  • In English: The filter appears correct because "All activities" starts with "A" and sits at the top of the list.
Image
  • In other languages (e.g., Catalan or Spanish): The first item changes (e.g., "Àrea de text..." in Catalan or "Archivo" in Spanish). As a result, the user sees a specific activity type selected in the dropdown, even though the list below is still showing every activity.
Image

Expected behavior:
The dropdown filter should explicitly default to the value all ("All activities") upon the first page load, regardless of the interface language or alphabetical sorting. The UI state must always reflect the data currently being displayed in the report.

Steps to reproduce:

  1. Set the site or user language to Catalan or Spanish.
  2. Navigate to the "Dates" report of any course (/report/editdates/index.php).
  3. Observe that the dropdown shows a specific activity (the first one alphabetically), but the table below shows all course activities.

Suggested fix:
Force the activitytype select element to default to the all value during the initial page render in the PHP/Output component, rather than relying on the browser's default selection of the first index.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions