overrides get overwritten

Created on 12 November 2024, 2 months ago

Problem/Motivation

When trying to add an override in a custom module I found that the overrides weren't getting run

Steps to reproduce

attempt to create an override and ovserver that the override isn't getting executed

Proposed resolution

I looked at the code and when the uppy instance is being created I saw

      // Keep track of it globally.
      settings.uppyOverrides = settings.uppyOverrides || {}; // the overrides objectwas getting created (if it didn't already exist)
      settings.uppyOverrides[id] ={"instance":uppy,"overrides":{}} // the instance was added for the uppy instance (with the instance added, but any overrides already existing was wiped out)

Instead we should

       // Keep track of it globally.
       settings.uppyOverrides = settings.uppyOverrides || {};
       // set the overrides and uppy instance for the current field identified by "id"
       settings.uppyOverrides[id] = settings.uppyOverrides[id] || {}; // ensure that the uppy instance has its own section of uppyOverrides
       settings.uppyOverrides[id].overrides = settings.uppyOverrides[id].overrides || {}; // add the overrides object (if it doesn't already exist)
       settings.uppyOverrides[id].instance = uppy; // add the uppy isntance

Remaining tasks

fork
push code to fork
create merge request
merge merge request
close ticket

User interface changes

none

API changes

none

Data model changes

none

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jrglasgow Idaho

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024