Reflect the status of the ILT configuration in the available module types

Created on 21 September 2023, about 1 year ago
Updated 22 September 2023, about 1 year ago

When we uninstall the content plugin Opigno Instructor-Led Training /admin/group/types/manage/learning_path/content here, the Instructor Led Course item is still available when creating a new module, and results in an error when trying to save it.

Resolution: listen to the status of the content plugin when fetching the available module types.

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇨🇭Switzerland mathilde_dumond

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @mathilde_dumond
  • Status changed to Needs review about 1 year ago
  • 🇨🇭Switzerland mathilde_dumond

    with the patch

  • Status changed to Needs work about 1 year ago
  • 🇨🇭Switzerland berdir Switzerland
    +++ b/src/Controller/OpignoGroupManagerController.php
    @@ -955,6 +969,9 @@ class OpignoGroupManagerController extends ControllerBase {
         $moxtra_status = $this->moduleHandler->moduleExists('opigno_moxtra') && _opigno_moxtra_get_organization_status();
     
    +    // Check if ILT is enabled.
    +    $plugin_ids = $this->pluginManagerGroupContentEnabler->getInstalledIds($group->getGroupType());
    +    $ILT_status = in_array('opigno_ilt_group', $plugin_ids);
         // For each content type available,
    

    don't hardcode the id. you can find it in the plugin definition ($contnet_type_definition), then this will work for any type.

    so get the list of enabled ids and in the loop do the in_array() check.

  • Status changed to Needs review about 1 year ago
  • 🇨🇭Switzerland mathilde_dumond

    Thanks @berdir, fixed that

Production build 0.71.5 2024