Imposible Add member to learningPath

Created on 9 December 2022, about 2 years ago
Updated 19 May 2023, over 1 year ago

Problem/Motivation

I have 14000 Class and 4000 users in my Opigno lms 3.0.4.
Then i want add user in training the user list keep empty.

I have not possibility to add member to training

Steps to reproduce

- Install Opigno LMS 3.0.4 PHP 8.0 or 8.1
- Add more 2000 users
- Create a training
- Try to add member in training
In Chrome debug console aftem more 2 minutes
POST http://DOMAIN/fr/user_selection/users 502 (Bad Gateway)

Proposed resolution

For test i try to comment the line 5 to line 21 in userselect.js i view the user list, but is not a solution.

Remaining tasks

User interface changes

Maybe less sexy but functional

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡«πŸ‡·France mdphoto Loriol Sur DrΓ΄me

Live updates comments and jobs are added and updated live.
  • Performance

    It affects performance. It is often combined with the Needs profiling tag.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ͺπŸ‡ΉEthiopia tsega

    I believe with a large number of users, classes and trainings the add member form takes a very long time to load the user list; somewhere around > 3minutes. The site I'm working on has about 9K users.

    This results in very poor user experience.

    I am looking for ways to limit the initial load of users, e.g. 100 unfiltered users then as the user types in the search box fetch filtered users again limited to 100. Same thing goes for Class and Member filter.

  • πŸ‡ΊπŸ‡ΈUnited States pixiekat

    I've had this happen too on my site with a large user base. The list to populate users on the add members to learning path form takes a while to load.

  • πŸ‡«πŸ‡·France mdphoto Loriol Sur DrΓ΄me

    Hi,
    Maybe my patch could help.
    The path remove the Opigno system and call the default system from group module to add members not class.

  • πŸ‡³πŸ‡¬Nigeria chike Nigeria

    In my case, I installed the latest version of Opigno and while setting up and applying patches along the way I got to the stage of adding members to the training then I found out users and classes were not loading on the page. When I click on 'Add members', an existing class will flash and then go away and there will then be no classes nor users displayed. When I got to this stage I had only one admin user account on the site and on the 'Add members' I was able to create two users and a Class. Whether they were added on the training I couldn't tell as the users and classes were not loading on the page.

    No way to add a user or class on the training.

    Then I applied patch #4 here and, just like the author said in #4, the patch swaps out Opigno's handling of the feature to rely on the Group module, so the interface looked different from the default Opigno system. And then I am able to only add users to training and can't add classes.

    Here is what I found on the console before I applied this patch,

    The first error I found:

    A form field element should have an id or name attribute

    A form field element has neither an id nor a name attribute. This might prevent the browser from correctly autofilling the form.

    To fix this issue, add a unique id or name attribute to a form field. This is not strictly needed, but still recommended even if you have an autocomplete attribute on the same element.

    Affected resource is this markup

    <div class="input-group"><input placeholder="Filter by users" class="form-control"></div>
    rendered from this file, modules\contrib\opigno_learning_path\modules\opigno_user_selection\templates\entity-selector.html.twig

    The second error I found is:

    Incorrect use of < label for=FORM_ELEMENT >

    The label's for attribute doesn't match any element id. This might prevent the browser from correctly autofilling the form and accessibility tools from working correctly.

    To fix this issue, make sure the label's for attribute references the correct id of a form field

    Affected resource is this markup,

    <label for="edit-training-users">Find existing users or groups</label>
    rendered from this file, themes\contrib\aristotle\templates\form\form-element.html.twig

    I attempted fixing these errors but couldn't so I am relying on this patch which I will consider it a workaround until there is a fix.

    On the site is "drupal/opigno_learning_path": "~3.2.0"

  • πŸ‡³πŸ‡¬Nigeria chike Nigeria

    I am thinking that the fact I had no users on the site when I got to the 'Member's page is getting me confused about what is working and what is not.

    Now I took off patch #4 and created two users from 'People > Add user' and when I got back to 'Members' page and clicked on 'Add members' I was able to see the two users I created and I could add them to the training. So I think there is no issue about discovering users and adding them to trainings, at least for sites not having too many users count as is my case. What I still find not working is adding classes to trainings. I created a class and when I got to 'Add members' page and clicked on 'Classes' tab, I didn't see any classes loaded.

    So I don't see what issue patch #4 solves, maybe it addresses sites with large volume of users, but I have taken it off and I could add users to trainings.

  • πŸ‡³πŸ‡¬Nigeria chike Nigeria

    I am really sorry for messing up this issue. It is all my fault. I wasn't seeing classes to add to trainings because I created classes but didn't add members to the classes. Now I added two members to one of the classes and boom, it showed up and I was able to add the class to a training.

    So in my case, this issue does not exist. I can add users and classes to trainings without any issues and without needing any patches.

    Sorry again for the mix up.

    Thank you.

Production build 0.71.5 2024