mjordan / islandora_workbench

A command-line tool for managing content in an Islandora 2 repository
MIT License
24 stars 40 forks source link

apparent typo in write_to_output_csv function in workbench_utils.py #851

Open edlington opened 2 hours ago

edlington commented 2 hours ago

Version of Islandora Workbench I'm using is commit hash: 4f3b5e0

When I run migration and add output file to create task following error displays. Looks like in the code node_dict[fifileeld_name] should be changed to node_dict[field_name] maybe. At least that's my guess.

/home/.../islandora_workbench/islandora_workbench/workbench:3620 in │ │ │ │ │ │ 3617 │ │ 3618 try: │ │ 3619 │ if config["task"] == "create": │ │ ❱ 3620 │ │ create() │ │ 3621 │ if config["task"] == "update": │ │ 3622 │ │ update() │ │ 3623 │ if config["task"] == "delete": │ │ │ │ /home/.../islandora_workbench/islandora_workbench/workbench:430 in │ │ create │ │ │ │ 427 │ │ │ if "output_csv" in config.keys(): │ │ 428 │ │ │ │ # We pass a copy of the row into this function because Python. │ │ 429 │ │ │ │ write_to_output_csv( │ │ ❱ 430 │ │ │ │ │ config, id_field, node_response.text, copy.deepcopy(row) │ │ 431 │ │ │ │ ) │ │ 432 │ │ else: │ │ 433 │ │ │ message = "Node for CSV record " + id_field + " not created" │ │ │ │ /home/.../islandora_workbench/islandora_workbench/workbench_utils.py: │ │ 8536 in write_to_output_csv │ │ │ │ 8533 │ │ for field_name in node_dict: │ │ 8534 │ │ │ if fieldname.startswith("field"): │ │ 8535 │ │ │ │ row[field_name] = serialize_field_json( │ │ ❱ 8536 │ │ │ │ │ config, field_definitions, field_name, node_dict[fifileeld_name] │ │ 8537 │ │ │ │ ) │ │ 8538 │ │ row.update(input_csv_row) │ │ 8539 │ writer.writerow(row) │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ NameError: name 'fifileeld_name' is not defined

edlington commented 2 hours ago

Apologies if this was already flagged and fixed

mjordan commented 2 hours ago

Yes, that typo was fixed in https://github.com/mjordan/islandora_workbench/pull/835.