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

untested fix for bug introduced by fix for #67 #101

Closed
wants to merge 1 commit into from

Conversation

durka
Copy link
Member

@durka durka commented Oct 1, 2014

I am not sure I agree that #67 was a bug -- I kind of liked having "All" and "Virtual combination" at the top (not that I ever use that interface...).

That aside, the fix for #67 introduced a bug, in that (nearly) all the option values are blank, which means the database is stuck on "All" and you can't change it. This is because the language name is used as a key into the %Db hash to look up the option value, but once the language name is trimmed, the hash lookup breaks. This bandaid fix keeps the untrimmed value around for use in the foreach loop (in a civilized language, we'd use zipWith :) ).

I don't have a running instance of jbovlaste so obviously this fix hasn't been tested. I "tested" it in a REPL with fake data, but I don't know what the real data looks like. And I don't know Perl, so YMMV.

I also fixed the indentation of the Strategy and Database loops.

@lagleki
Copy link
Contributor

lagleki commented Oct 1, 2014

2014-10-01 6:52 GMT+04:00 Alex Burka [email protected]:

I am not sure I agree that #67
#67 was a bug

Some people complained that they couldn't find the necessary direction.

-- I kind of liked having "All" and "Virtual combination" at the top (not
that I ever use that interface...).

Those can still be left on top.

Also i noticed that sometimes after choosing a different direction and
pressing "Submit" the selected direction changes back to something
different.

That aside, the fix for #67 #67

introduced a bug, in that (nearly) all the option values are blank, which
means the database is stuck on "All" and you can't change it. This is
because the language name is used as a key into the %Db hash to look up the
option value, but once the language name is trimmed, the hash lookup
breaks. This bandaid fix keeps the untrimmed value around for use in the
foreach loop (in a civilized language, we'd use zipWith :) ).

I don't have a running instance of jbovlaste so obviously this fix hasn't
been tested. I "tested" it in a REPL with fake data, but I don't know what
the real data looks like. And I don't know Perl, so YMMV.

I also fixed the indentation of the Strategy and Database loops.

You can merge this Pull Request by running

git pull https://github.com/durka/jbovlaste fix-language-dropdown

Or view, comment on, or merge it at:

#101
Commit Summary

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#101.

@teleological
Copy link
Contributor

I'm sorry, I didn't see this PR before I committed d544d40, which trims the strings as the hash of languages is built up. I'd welcome a PR to give the special options (all/virtual) a custom sort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants