Orcpub / orcpub

Code for Dungeon Master's Vault Community Edition
https://www.dungeonmastersvault.com/
Eclipse Public License 2.0
212 stars 106 forks source link

Problem with Selection Builder #174

Open nSword0 opened 5 years ago

nSword0 commented 5 years ago

Describe the bug When using the Selection Builder, after adding selections, attempting to save will result in an error claiming that the Name and Source need to be filled out, even when they clearly are already filled. This seems to only happen when selection options are actually added.

To Reproduce

  1. Create new blank Selection
  2. Fill out Name and Source
  3. It saves as normal
  4. Add a selection option
  5. Saving will no longer work
  6. Removing all of the selection options will allow the selection to be saved again

Screenshots what

Desktop

EDIT: Could editing a file imported from an .orcbrew have something to do with this?

DivertedCircle commented 5 years ago

I've run into this occasionally, usually when there is an invalid character in the 'Name' or 'Option Source Name' sections. Try deleting a character and then reentering it.

codeGlaze commented 5 years ago

Yeah text sanitization is something that slipped under the radar again. I bright it up in a different issue but u though I liked it with an unrelated topic.

Dandaman110 commented 4 years ago

Still having this issue, is there any fix for it? Figured since this had been brought up an entire year ago, I'd make a new issue but that got shut down. Don't suppose anyone has any actual help in this?

DivertedCircle commented 4 years ago

I believe the only times we've been able to replicate it is when there were numbers used in the 'Name' or 'Option Source'. If you don't have numbers there then there is a different issue that we don't have sufficient information to replicate. You're going to have to provide a screenshot of your exact Selection settings that are causing the error.

codeGlaze commented 4 years ago

@Dandaman110 does this occur when you use an incognito browser window with no other orcbrew loaded?

Dandaman110 commented 4 years ago

image

no numbers in the names, and it won't even let me log in on Incognito for some reason, so apparently that's a thing. Clicking login doesn't give any response.

Dandaman110 commented 4 years ago

For some reason, now I can have 5 selections before adding any more will prevent me from saving.

codeGlaze commented 4 years ago

What browser is that?

You don't need to log in to create homebrew selections... But the login not working incognito is incredibly weird.

Incognito shouldn't prevent you from logging in... Can you try disabling your ad blocker?

Your symptoms smack of JavaScript erroring for some reason.

Opening your console window and screenshoting any errors might help too.

DivertedCircle commented 4 years ago

In addition to codeGlaze's questions, what names are you giving the additional selections?

datdamnzotz commented 4 years ago

Boils down to it wasn't implemented correctly. Larry is using the "Name" and "Option Source Name" as a keywords in the local edn storage. These strings should checked if they are keyword 'safe' and aren't.

image

Needs to be re-written to use a uuid or some other keyword safe check when saving.

In a nutshell don't use special characters in the Name or Option Source Name as they are not supported as elements names. ref https://github.com/edn-format/edn

symbols Symbols are used to represent identifiers, and should map to something other than strings, if possible.

Symbols begin with a non-numeric character and can contain alphanumeric characters and . * + ! - _ ? $ % & = < >. If -, + or . are the first character, the second character (if any) must be non-numeric. Additionally, : # are allowed as constituent characters in symbols other than as the first character.

/ has special meaning in symbols. It can be used once only in the middle of a symbol to separate the prefix (often a namespace) from the name, e.g. my-namespace/foo. / by itself is a legal symbol, but otherwise neither the prefix nor the name part can be empty when the symbol contains /.

If a symbol has a prefix and /, the following name component should follow the first-character restrictions for symbols as a whole. This is to avoid ambiguity in reading contexts where prefixes might be presumed as implicitly included namespaces and elided thereafter.

keywords Keywords are identifiers that typically designate themselves. They are semantically akin to enumeration values. Keywords follow the rules of symbols, except they can (and must) begin with :, e.g. :fred or :my/fred. If the target platform does not have a keyword type distinct from a symbol type, the same type can be used without conflict, since the mandatory leading : of keywords is disallowed for symbols. Per the symbol rules above, :/ and :/anything are not legal keywords. A keyword cannot begin with ::

If the target platform supports some notion of interning, it is a further semantic of keywords that all instances of the same keyword yield the identical object.

Dandaman110 commented 4 years ago

Must have been the adblocker stopping the incognito login, turned it off and it logs in fine, it's Chrome.

image

It'll let me save 7 selections now, seems totally random but ok.

I'm using the names "Afterimage Dash", "Afterimage Strike", "Close Combat Fighter", "Devastation Wave", "Fists of Fury", "Fists of Iron", and "Grappling Expertise". I can't see any of the names themselves causing any issues, they're just straight up letters.

datdamnzotz commented 4 years ago

If you have an existing section, edit by going to my content-> expand your option source -> section -> edit image If you go to section builder and try to overwrite the existing one you will get that error as well.

Dandaman110 commented 4 years ago

Weird, ok, so i accessed the selection i was having trouble with through My Content and edited it there i was able to add all the selections i wanted to, no problems, instead of editing a newly made selection, if my janky way of describing makes any sense. So yeah for some reason it now works, issue resolved I guess?

datdamnzotz commented 4 years ago

There's a bug there. When you click on the section builder, it re-uses any pre-existing ones if you may have started. The section builder button really needs to reset the form and start blank. Looks like fiddling with it it doesn't clear properly. (That and it could use a drop down from pre-existing sources if you want to add to them but that's another issue #129 ) image

Always best to edit existing ones from the My Content -> edit section.