opis/json-schema dependency missing

Created on 23 May 2022, over 2 years ago
Updated 4 February 2023, almost 2 years ago

Error: Class 'Opis\JsonSchema\Validator' not found in Drupal\opigno_scorm\Controller\OpignoScormController->scormCommit() (line 84 of /code/web/modules/contrib/opigno_scorm/src/Controller/OpignoScormController.php)

🐛 Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

🇺🇸United States cornifex

Live updates comments and jobs are added and updated live.
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.

  • 🇨🇦Canada Liam McDermott

    Liam McDermott made their first commit to this issue’s fork.

  • @liam-mcdermott opened merge request.
  • 🇨🇦Canada Liam McDermott

    I created an MR that adds the dependency, and tested it.

    Hey cornifex, thanks for the patch. Unfortunatelly it doesn't work for me and I'm still getting the error.

    This would be due to patches being applied after composer has resolved dependencies, because of this, adding new dependencies in patches doesn't work.

    Instead, if you add this to your project's `composer.json` as the first item under `repositories`:

            {
                "type": "vcs",
                "url": "git@git.drupal.org:issue/opigno_scorm-3281986.git"
            },
    

    And put this under your `composer.json`'s `require` section:

            "drupal/opigno_scorm": "dev-3281986-json-schema-dep-missing",
    

    It should fix the issue. Or you can add it as a direct dependency, like saurabh-2k17 suggested, but that won't help test the fix for this issue. If the above works for anyone else, please come and mark this as 'Reviewed and tested by the community'.

    To reproduce this issue, install Opigno SCORM without any of the other Opigno modules, then upload a SCORM file to some content, load that content in the browser, then open the browser console and interact with the loaded SCORM content. When moving between steps this error should be shown in the console (it's a JS http request).

  • Issue was unassigned.
  • Status changed to RTBC 10 months ago
  • 🇺🇸United States kurttrowbridge

    Hi! I followed the instructions in #7 while also excluding this module from the standard Drupal repository (see snippet below), and that installed the dependencies successfully and fixed the errors. Marking RTBC. Thanks!

        "repositories": [
            {
                "type": "composer",
                "url": "https://packages.drupal.org/8",
                "exclude": [
                    "drupal/opigno_scorm"
                ]
            },
            ...
            {
                "type": "vcs",
                "url": "git@git.drupal.org:issue/opigno_scorm-3281986.git"
            }
        ],
    
  • 🇩🇪Germany Peter Majmesku 🇩🇪Düsseldorf

    I do also confirm that the changes from the MR do work for my project.

    You must be careful, that you really install the ^2.3 version and not just the latest version. Because the latest version of opis/json-schema cannot be auto-loaded via composer.

Production build 0.71.5 2024