-
Notifications
You must be signed in to change notification settings - Fork 0
Additional scripts
Michelle Janowiecki edited this page Apr 8, 2022
·
2 revisions
These are scripts not included in the workflow to post new repository items to Drupal 8.
deleteFiles.py
Script to delete files from Drupal 8 using the file_uuid.
getFileMetadata.py
Script that finds the file_uuid and uri for specific filenames (example: Levy-201-087_006.jpg).
getNode_levy_collection_item_withoutField.py
Script that finds up to 10,000 repository items missing a specific field (change field in line 18).
replaceImages.py
Script made to replace images in repository items.
- Finds old image file by its file_uuid.
- If old image is found, image is deleted.
- New image is posted to Drupal 8.
- Next, replaces old_id with new_id in the related collection_item_image paragraph.
Old image is deleted before the new image is posted to reduce errors. For instance, if you post the new image first and the filename of the new image is the same as the old image, Drupal 8 may throw an 422 error trying to post the new image to the same location.