Skip to content

Importing plugin with existing targetAttribute causes error when retrieving plugin schemas #2433

@dancgray

Description

@dancgray

Expected Behavior

Plugin manager should reject any attempt to import a plugin that uses a targetAttribute value that already exists.

Actual Behavior

Returns an error but continues to import the plugin. All subsequent calls to return schema result in a error.

error [25 Sep 19 09:45:39 +01:00] Already found extension course attribute with key _assessment (adapt-contrib-superassessment) Error: Already found extension course attribute with key _assessment (adapt-contrib-superassessment) at /source/adapt/adapt_authoring/lib/contentmanager.js:702:31 at /source/adapt/adapt_authoring/node_modules/async/dist/async.js:3110:16 at eachOfArrayLike (/source/adapt/adapt_authoring/node_modules/async/dist/async.js:1069:9) at eachOf (/source/adapt/adapt_authoring/node_modules/async/dist/async.js:1117:5) at Object.eachLimit (/source/adapt/adapt_authoring/node_modules/async/dist/async.js:3172:5) at processPluginLocations (/source/adapt/adapt_authoring/lib/contentmanager.js:689:13) at processPlugin (/source/adapt/adapt_authoring/lib/contentmanager.js:652:7) at /source/adapt/adapt_authoring/lib/contentmanager.js:636:15 at /source/adapt/adapt_authoring/node_modules/async/dist/async.js:3110:16 at replenish (/source/adapt/adapt_authoring/node_modules/async/dist/async.js:1011:17) at /source/adapt/adapt_authoring/node_modules/async/dist/async.js:1016:9 at eachLimit$1 (/source/adapt/adapt_authoring/node_modules/async/dist/async.js:3196:24) at Object.<anonymous> (/source/adapt/adapt_authoring/node_modules/async/dist/async.js:1046:16) at /source/adapt/adapt_authoring/lib/contentmanager.js:635:19 at /source/adapt/adapt_authoring/node_modules/mongoose/lib/model.js:4845:16 at /source/adapt/adapt_authoring/node_modules/mongoose/lib/utils.js:264:16 at _hooks.execPost (/source/adapt/adapt_authoring/node_modules/mongoose/lib/query.js:4258:11) at /source/adapt/adapt_authoring/node_modules/mongoose/node_modules/kareem/index.js:135:16 at process._tickCallback (internal/process/next_tick.js:61:11)

Steps to Reproduce

  1. Duplicate an extension with a new name but retain the targetAttribute, in this case adapt-contrib-superassessment is a copy of adapt-contrib-assessment
  2. Upload the new plugin to an AT that has the original plugin installed
  3. Returns an error but installs the plugin
  4. All subsequent calls to get schema return an error preventing login, dashboard load etc.

Versions

  • Authoring Tool Version: v0.10.0
  • Framework Version: v4.3.0
  • Node.js Version: v10.15.3
  • MongoDB Version: v3.6
  • Operating System: macOS 10.14.6
  • Browser: n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions