Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin app fails to update partners if existing document is malformed #8027

Open
dianabarsan opened this issue Jan 16, 2023 · 0 comments
Open
Labels
Help wanted Good for first time contributions Type: Bug Fix something that isn't working as intended

Comments

@dianabarsan
Copy link
Member

Describe the bug
A malformed partners doc will block the user from updating partners from the admin app.

To Reproduce
Steps to reproduce the behavior:

  1. Create a partners.json document in your config. Set the contents of this document to be {}. run cht upload-partners.
  2. Login to admin app. Go to Images -> Partners.
  3. Add a new "partner".
  4. Click Submit.
  5. See error There was an error saving your settings, please try again..

Expected behavior
The UI should inform the user that the existing document is malformed.
Even when the document is malformed, the user should have the possibility to "fix" it by editing from the Admin UI.

Logs
When loading the partners page:

angular.js:15697 TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at resource-icons.js:111:24
    at processQueue (angular.js:18075:1)
    at angular.js:18123:1
    at Scope.$digest (angular.js:19242:1)
    at angular.js:19562:1
    at TaskTracker.completeTask (angular.js:21403:1)
    at angular.js:6879:1 'Possibly unhandled rejection: {}'

When saving:

angular.js:15697 Error uploading image TypeError: Cannot set properties of undefined (setting 'partner-name')
    at images-partners.js:54:27
    at processQueue (angular.js:18075:1)
    at angular.js:18123:1
    at Scope.$digest (angular.js:19242:1)
    at angular.js:19562:1
    at TaskTracker.completeTask (angular.js:21403:1)
    at angular.js:6879:1

Environment

  • Instance: any
  • App: admin
  • Version: 3.4.0+

Additional context
Form post

@dianabarsan dianabarsan added the Type: Bug Fix something that isn't working as intended label Jan 16, 2023
@garethbowen garethbowen added the Help wanted Good for first time contributions label Mar 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help wanted Good for first time contributions Type: Bug Fix something that isn't working as intended
Projects
Status: Todo
Development

No branches or pull requests

2 participants