Unable to add a Activity from the existing catalog

Created on 8 February 2023, almost 2 years ago
Updated 12 July 2023, over 1 year ago

Problem/Motivation

Unable to add a Activity from the existing catalog

Steps to reproduce

  1. Go to admin/structure/opigno-modules
  2. Click in Edit operation of a existing module
  3. Click in View tab
  4. Click in Activities tab
  5. Click in Add activity
  6. Click in a existing activite type
  7. Then Search for an activity
  8. Click on the activity found
  9. Nothing happens, because an error occurs in JavaScript

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇧🇷Brazil bmagalhaes

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

Comments & Activities

  • Issue created by @bmagalhaes
  • 🇪🇸Spain dpavon

    I might be facing this issue, and can maybe provide more info:

    The error in JS is truly a 404 exception that is caught by the JS main.bundle.js. This is triggered due to the checkbox of selecting the existing activity in the sidebar using url: "https://DOMAIN/module/19/add-activity/57/group/DOMAIN,opigno_module,19,i..."

    As you can see, this is not a proper url since this routing should be:

    opigno_module.manager.add_module_activity:
      path: '/module/{opigno_module}/add-activity/{opigno_activity}/group/{group}'
    

    This "group" variable is then not properly handled by the JS app, since I would expect a numeric ID to be present on the group. I would assume the error is around this file:
    * "opigno_group_manager/ng/src/app/activities/activities.service.ts"

    Probably here, or whoever is passing that "group" variable:

      addActivity(moduleId, activityId): Observable<any> {
        const group = this.getParams(window.location.href, 'group');
        return this.http
          .get(this.apiBaseUrl + this.appService.replaceUrlParams(this.addActivityUrl, { '%opigno_module': moduleId, '%opigno_activity': activityId, '%group_id': group }))
          .map(response => response.json() as any);
      }
    

    But this is all guessing, since I'm not sure how to debug the JS app easily.

Production build 0.71.5 2024