Skip to content

form-inline deprecation warning in Moodle 5.1 #213

@emily-lambrou

Description

@emily-lambrou

Description

During testing for Moodle 5.1 compatibility, a deprecation warning was identified related to the usage of the Bootstrap class form-inline.

In Moodle 5.1, the form-inline class is deprecated and triggers the following warning in the UI:

Deprecated style in use (.form-inline)

  • This warning appears when viewing participant management within the plugin interface.

📷 Screenshot showing the issue:

Image

Root Cause

  • The plugin currently outputs HTML containing:
echo '<br /><div class="buttons"><div class="form-inline">';
  • This line is located in mod/reengagement/view.php

  • The form-inline class was used in older Bootstrap implementations but is no longer recommended in Moodle 5.x UI guidelines.

Proposed Fix

  • Replace the deprecated form-inline class with Bootstrap utility classes compatible with Moodle 5.x.

Current code

echo '<br /><div class="buttons"><div class="form-inline">';

Suggested replacement

echo '<br /><div class="buttons"><div class="d-flex flex-wrap gap-2 align-items-center">';

  • This change removes the deprecated class and uses modern Bootstrap flex utilities.

Why this fix works

The replacement uses standard Bootstrap layout utilities supported by Moodle:

  • d-flex : Enables flex layout
  • flex-wrap : Allows items to wrap to the next line
  • gap-2 : Adds spacing between elements\
  • align-items-center : Aligns elements vertically

These utilities replicate the layout behavior that form-inline previously provided.

Moodle Version Compatibility

Moodle 5.1

  • This change removes the deprecated .form-inline usage, eliminating the warning and aligning with Moodle 5.1 UI practices.

Moodle 4.5

  • The change does not negatively affect Moodle 4.5 because:

  • The replacement classes (d-flex, flex-wrap, gap-2, align-items-center) are standard Bootstrap utility classes already supported in Moodle 4.5.

  • They only affect layout styling, not functionality.

  • No JavaScript or backend logic is modified.

  • The HTML structure remains unchanged.

Testing in a Moodle 4.5 environment confirmed that the plugin continues to function normally and the UI renders correctly.

Scope of Change

  • Replace deprecated .form-inline class

  • Maintain the same layout behaviour using Bootstrap utilities

  • No functional changes to the plugin

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