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

Default Regex for Location applied when editing existing submode #67

Closed
jsubhi opened this issue Sep 3, 2019 · 3 comments
Closed

Default Regex for Location applied when editing existing submode #67

jsubhi opened this issue Sep 3, 2019 · 3 comments
Labels
fixed Issue is fixed

Comments

@jsubhi
Copy link
Collaborator

jsubhi commented Sep 3, 2019

When editing an existing submode, the fields "Standort" and "RegEx Standort" are filled with the default values from config.json even if the submode was previously saved without a "RegEx Standort". One has to remember to empty the "RegEx Standort" field before saving the modifications otherwise an incorrect location filter will be applied for this submode.

EliDeh added a commit that referenced this issue Sep 4, 2019
@EliDeh EliDeh added the fixed on dev Issue is fixed on the dev branch label Sep 4, 2019
@jsubhi
Copy link
Collaborator Author

jsubhi commented Sep 4, 2019

Unfortunately not fixed in 1.1.1-g.

How to reproduce:

  • Using default config.json with "location": "MAG",
  • Open config editor, choose "defaultMode" and "default_gross"
  • Standort shows "MAG" and RegEx Standort shows "^MAG$" both in black (not grey) font
    dfaultMode.json before any change:
    {
    "id": 0,
    "format": "default_gross",
    "useRegEx": true,
    "exampleShelfmark": "PÄD:TG:1420:Dan::2017",
    "regEx": "(.):(.):(.):(.):(.):(.)",
    "delimiter": ":",
    "result": ["Standort: $LOC", "$1 $2", "$3", "$4", "$5", "$6"]
    },
  • Change some other field except "Standort" or "RegEx Standort" (In this case add a "b" at the End of "Beispiel"), klick "Speichern und Beenden"
  • dfaultMode.json now contains RegEx for location:
    {
    "id": 0,
    "format": "default_gross",
    "useRegEx": true,
    "exampleShelfmark": "PÄD:TG:1420:Dan::2017b",
    "regEx": "(.):(.):(.):(.):(.):(.)",
    "delimiter": ":",
    "result": [
    "Standort: $LOC",
    "$1 $2",
    "$3",
    "$4",
    "$5",
    "$6"
    ],
    "exampleLoc": "MAG",
    "locRegEx": "^MAG$"
    },

Expected behaviour:
Fields "Standort" and "RegEx Standort" are empty or show only greyed-out sample content.
"locRegEx" is only added if one explicitly types somthing into the corresponding field.

Current behaviour is very problematic since one can accidentally add a filter that in most cases would render the entire format non-functional.

Maybe it would be easiest to just skipt the whole "Sample Location" and just leave the field empty unless the user adds some content?

EliDeh added a commit that referenced this issue Sep 4, 2019
@EliDeh
Copy link
Collaborator

EliDeh commented Sep 4, 2019

Thank you for the detailed report.
I just released a hotfix.

@jsubhi
Copy link
Collaborator Author

jsubhi commented Sep 4, 2019

Works as expected now! Thanks for the quick fix!

@jsubhi jsubhi closed this as completed Sep 4, 2019
@EliDeh EliDeh added fixed Issue is fixed and removed fixed on dev Issue is fixed on the dev branch labels Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed Issue is fixed
Projects
None yet
Development

No branches or pull requests

2 participants