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

Multiselect sends null value even if option is selected #18001

Closed
mvdbeek opened this issue Apr 16, 2024 · 3 comments
Closed

Multiselect sends null value even if option is selected #18001

mvdbeek opened this issue Apr 16, 2024 · 3 comments

Comments

@mvdbeek
Copy link
Member

mvdbeek commented Apr 16, 2024

Unclear how exactly the user has done this, but this parameter definition

        <param name="overlap_mode" type="select" multiple="true" label="What should be written to the output file?">
            <option value="-wa">
                Write the original entry in A for each overlap (-wa)
            </option>
            <option value="-wb">
                Write the original entry in B for each overlap. Useful for knowing what A overlaps. Restricted by the fraction- and reciprocal option (-wb)
            </option>
            <option value="-wo">
                Write the original A and B entries plus the number of base pairs of overlap between the two features. Only A features with overlap are reported. Restricted by the fraction- and reciprocal option (-wo)
            </option>
            <option value="-wao">
                Write the original A and B entries plus the number of base pairs of overlap between the two features. However, A features w/o overlap are also reported with a NULL B feature and overlap = 0. Restricted by the fraction- and reciprocal option (-wao)
            </option>
            <option value="-loj">
                Perform a "left outer join". That is, for each feature in A report each overlap with B.  If no overlaps are found, report a NULL feature for B (-loj)
            </option>
        </param>

from bedtools intersect
led to:

TypeError: sequence item 0: expected str instance, NoneType found
  File "galaxy/web/framework/decorators.py", line 346, in decorator
    rval = func(self, trans, *args, **kwargs)
  File "galaxy/webapps/galaxy/api/tools.py", line 247, in build
    return tool.to_json(trans, kwd.get("inputs", kwd), history=history)
  File "galaxy/tools/__init__.py", line 2509, in to_json
    populate_state(request_context, self.inputs, params.__dict__, state_inputs, state_errors)
  File "galaxy/tools/parameters/__init__.py", line 412, in populate_state
    _populate_state_legacy(
  File "galaxy/tools/parameters/__init__.py", line 625, in _populate_state_legacy
    check_param(request_context, input, param_value, context, simple_errors=simple_errors)
  File "galaxy/tools/parameters/__init__.py", line 246, in check_param
    value = param.from_json(value, trans, param_values)
  File "galaxy/tools/parameters/basic.py", line 1045, in from_json
    f"invalid options ({','.join(set(value) - set(legal_values))!r}) were selected (valid options: {','.join(legal_values)})",

where value is

[None,  '-wb']

I can partially fix this on the backend so that a proper error is returned, however this selection is wrong and needs to be fixed on the client.

@mvdbeek
Copy link
Member Author

mvdbeek commented Apr 16, 2024

Figured it out, click on switch to column select before interacting with the values, and see that 1 items is already selected, I suppose that's null:

Screenshot 2024-04-16 at 17 26 30

@mvdbeek mvdbeek changed the title Multiselect sends None value even if option is selected Multiselect sends null value even if option is selected Apr 16, 2024
@ahmedhamidawan
Copy link
Member

ahmedhamidawan commented Apr 16, 2024

Figured it out, click on switch to column select before interacting with the values, and see that 1 items is already selected, I suppose that's null

Oh, I think this part is fixed in #17990

@dannon dannon moved this from Triage/Discuss to To Do, Assigned in UI/UX Working Group - weeklies Apr 16, 2024
@mvdbeek
Copy link
Member Author

mvdbeek commented Apr 18, 2024

Fixed in #17990 & #18002

@mvdbeek mvdbeek closed this as completed Apr 18, 2024
@ahmedhamidawan ahmedhamidawan moved this from To Do, Assigned to Done in UI/UX Working Group - weeklies Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants