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

Check didn't flag extra pipe characters in custom typed relation field #405

Closed
dara2 opened this issue Apr 4, 2022 · 3 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@dara2
Copy link

dara2 commented Apr 4, 2022

I am in Drupal 9.3.3, running the latest Workbench from my local.
I have a site with a custom typed relation field. The CSV passed the --check process, but when I started to ingest, it failed with this error:

Traceback (most recent call last):
  File "./workbench", line 1130, in <module>
    create()
  File "./workbench", line 257, in create
    subvalues = split_typed_relation_string(config, row[custom_field], target_type)
  File "/home/islandora/islandora_workbench/workbench_utils.py", line 1601, in split_typed_relation_string
    if value_is_numeric(item_list[2]):
IndexError: list index out of range

When I looked at my CSV I saw the node that it was trying to ingest had data in the custom typed relation field like this, with an extra leading pipe character:

|local:dgc:person:Paschen, Elise|local:dgc:person:McManus, James

The --check had caught a similar issue in the Linked Agent typed relation field, but for some reason didn't catch this. When I looked in the rest of the CSV, there are several other places where this happens in this same custom field, none of which --check apparently caught. It would be helpful if --check caught this.

@mjordan mjordan self-assigned this Apr 12, 2022
@mjordan
Copy link
Owner

mjordan commented May 12, 2022

Note to MJ: All CSV field types should be checked for superfluous subdelimiter characters, not just typed relation fields.

@mjordan mjordan added the bug Something isn't working label Aug 10, 2022
@mjordan
Copy link
Owner

mjordan commented Mar 7, 2023

This could be added to clean_csv_values().

mjordan added a commit that referenced this issue Mar 7, 2023
@mjordan
Copy link
Owner

mjordan commented Mar 7, 2023

@dara2 sorry this took so long! Anyway, now all trailing and leading subdelimiter characters should be stripped from CSV values.

@mjordan mjordan closed this as completed Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants