Skip to content

Hidden query fields prevent exporting to web portal #8494

Description

@bronwyncombs

Describe the bug
A clear and concise description of what the bug is.

When a query has one or more hidden fields, exporting for web portal will send an error.

Error: list index out of range

Traceback:
Traceback (most recent call last):
  File "/opt/specify7/specifyweb/backend/stored_queries/execution.py", line 276, in do_export
    query_to_web_portal_zip(
  File "/opt/specify7/specifyweb/backend/stored_queries/execution.py", line 344, in query_to_web_portal_zip
    return _query_to_web_portal_zip(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/specify7/specifyweb/backend/stored_queries/web_portal_export.py", line 578, in query_to_web_portal_zip
    data_rows = list(query_rows)
                ^^^^^^^^^^^^^^^^
  File "/opt/specify7/specifyweb/backend/stored_queries/execution.py", line 1266, in apply_special_post_query_processing
    row = processor(row)
          ^^^^^^^^^^^^^^
  File "/opt/specify7/specifyweb/backend/stored_queries/web_portal_export.py", line 441, in trim_big_decimal
    previous_value = str(row[field_index])
                         ~~~^^^^^^^^^^^^^
IndexError: list index out of range

To Reproduce
Steps to reproduce the behavior:

  1. Go to database on v7.12.1

  2. Open a saved query or use Portal Mapping 2.json

  3. Ensure there are hidden fields / hide fields then run the query

  4. Click the "Export for Web Portal" button

  5. See error in notifications

Expected behavior
A clear and concise description of what you expected to happen.

Should create export with no error.

Please fill out the following information manually:

  • OS: macOS
  • Browser: chrome
  • Specify 7 Version: 7.12.1

Reported By
Bronwyn

Additional Context
work around (besides data exporter)

  1. unhide columns in query
  2. export for web portal
  3. unzip export and open csv
  4. remove columns that should be hidden

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    2 - Exporting DataIssues that are related to exporting data to DwC, GBIF, IPT, Web Portal, etc.2 - QueriesIssues that are related to the query builder or queries in general

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions