question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Modifying user permission failed when an optional custom field is empty

See original GitHub issue

Environment:

  • CTFd Version/Commit: 3.1.0-release
  • Operating System: ubuntu18.04
  • Web Browser and Version: chrome 85.0

What happened?

I set an optional custom field for my CTFd, I found when it’s empty, I can’t modify user permission. The submit button have no response. Here are the error log in console:

vendor.bundle.min.js?d=b4adfef4:150 Uncaught Error: Syntax error, unrecognized expression: :input[name=fields[3]]
    at Function.se.error (vendor.bundle.min.js?d=b4adfef4:150)
    at se.tokenize (vendor.bundle.min.js?d=b4adfef4:150)
    at se.select (vendor.bundle.min.js?d=b4adfef4:150)
    at Function.se [as find] (vendor.bundle.min.js?d=b4adfef4:150)
    at k.fn.init.find (vendor.bundle.min.js?d=b4adfef4:150)
    at eval (utils.js:43)
    at Array.map (<anonymous>)
    at k.fn.init._jquery.default.fn.serializeJSON (utils.js:38)
    at HTMLFormElement._ (user.min.js?d=b4adfef4:1)
    at HTMLFormElement.dispatch (vendor.bundle.min.js?d=b4adfef4:150)
se.error @ vendor.bundle.min.js?d=b4adfef4:150
se.tokenize @ vendor.bundle.min.js?d=b4adfef4:150
se.select @ vendor.bundle.min.js?d=b4adfef4:150
se @ vendor.bundle.min.js?d=b4adfef4:150
find @ vendor.bundle.min.js?d=b4adfef4:150
eval @ utils.js:43
_jquery.default.fn.serializeJSON @ utils.js:38
_ @ user.min.js?d=b4adfef4:1
dispatch @ vendor.bundle.min.js?d=b4adfef4:150
g.handle @ vendor.bundle.min.js?d=b4adfef4:150

When I set some value to that empty field, everything is all right. But it should be optional.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ColdHeatcommented, Sep 17, 2020

It looks like an updated version of @babel/core fixes this.

You can run the following to fix this in the meantime.

yarn add "@babel/core" --latest
yarn build
0reactions
ColdHeatcommented, Sep 18, 2020

@AXDOOMER do the above commands fix it for you? I can merge in #1654 in but I’m not sure if it will break something else.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error "One of the Required Fields Is Empty" When a User ...
Solution · Log in to the admin control panel. · From the Home tab, select Custom Fields and click Fields. · Click to...
Read more >
User Save fail if Optional Custom Select Field is left empty
Description: Leave optional (Required false) type select custom Fields empty and Save Users Profile not working.
Read more >
Empty Custom Field Display on View Issue Screen
We are trying to figure out a way to have it appear on the screen all of the time, even when it is...
Read more >
Manage Custom Fields | YouTrack Server Documentation
When a field is public, any user who has the Read Issue or Update Issue permissions in your project can view or edit...
Read more >
Adding custom fields to your tickets and support request form
Custom ticket fields can be required or optional. ... Customers can edit: Agents and end users can view and edit the field.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found