diff --git a/workbench b/workbench index 870842c..5760811 100755 --- a/workbench +++ b/workbench @@ -820,7 +820,10 @@ def update(): ) if node_has_all_fields is True: - node_endpoint = config["host"] + "/node/" + row["node_id"] + "?_format=json" + if value_is_numeric(row["node_id"]) is False: + row["node_id"] = get_nid_from_url_alias(config, row["node_id"]) + + node_endpoint = config["host"] + "/node/" + str(row["node_id"]) + "?_format=json" node_headers = {"Content-Type": "application/json"} # Make a GET request to the content type content_type_endpoint = f"{config['host']}/entity/node_type/{config['content_type']}?_format=json" @@ -852,11 +855,11 @@ def update(): "Node " + config["host"] + "/node/" - + row["node_id"] + + str(row["node_id"]) + " updated." ) logging.info( - "Node %s updated.", config["host"] + "/node/" + row["node_id"] + "Node %s updated.", config["host"] + "/node/" + str(row["node_id"]) ) else: if config["progress_bar"] is False: diff --git a/workbench_utils.py b/workbench_utils.py index a1f2ddd..d77e55d 100644 --- a/workbench_utils.py +++ b/workbench_utils.py @@ -3906,7 +3906,11 @@ def deduplicate_field_values(values): def get_node_field_values(config, nid): """Get a node's field data so we can use it during PATCH updates, which replace a field's values.""" - node_url = config["host"] + "/node/" + nid + "?_format=json" + + if value_is_numeric(nid) is False: + nid = get_nid_from_url_alias(config, nid) + + node_url = config["host"] + "/node/" + str(nid) + "?_format=json" response = issue_request(config, "GET", node_url) node_fields = json.loads(response.text) return node_fields