From 4a06d0d46a5036caf2fe957b77cdb312db169e10 Mon Sep 17 00:00:00 2001 From: Dirk Koritnik Date: Tue, 23 Apr 2024 11:14:43 +0200 Subject: [PATCH] Extend import to get copyrights (#53) --- .../FilesAssignment.php | 1 + Documentation/Changelog/3.6.0.rst | 27 +++++++++++++++++++ .../ImportHandlesImagesAddsNewImages.php | 3 +++ ...mportHandlesImagesUpdatesExistingImage.php | 2 ++ .../ImportHandlesImagesExistingData.php | 2 ++ ...ponseWithMultipleImagesForSingleEvent.json | 3 ++- .../Fixtures/ResponseWithNewImages.json | 3 ++- ext_emconf.php | 2 +- 8 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 Documentation/Changelog/3.6.0.rst diff --git a/Classes/Service/DestinationDataImportService/FilesAssignment.php b/Classes/Service/DestinationDataImportService/FilesAssignment.php index efe15cd..6cad16c 100644 --- a/Classes/Service/DestinationDataImportService/FilesAssignment.php +++ b/Classes/Service/DestinationDataImportService/FilesAssignment.php @@ -155,6 +155,7 @@ class FilesAssignment 'alternative' => $mediaObject['description'] ?? '', 'creator_tool' => 'destination.one', 'source' => $mediaObject['url'] ?? '', + 'copyright' => $mediaObject['source'] ?? '' ]); } diff --git a/Documentation/Changelog/3.6.0.rst b/Documentation/Changelog/3.6.0.rst new file mode 100644 index 0000000..9ac5831 --- /dev/null +++ b/Documentation/Changelog/3.6.0.rst @@ -0,0 +1,27 @@ +3.6.0 +===== + +Breaking +-------- + +Nothing + +Features +-------- + +* Import copyright from destination.one media object field source in file metadata field copyright. + +Fixes +----- + +Nothing + +Tasks +----- + +Nothing + +Deprecation +----------- + +Nothing diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesAddsNewImages.php b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesAddsNewImages.php index 6c866ed..7ed34b9 100644 --- a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesAddsNewImages.php +++ b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesAddsNewImages.php @@ -84,6 +84,7 @@ return [ 'alternative' => '', 'creator_tool' => 'destination.one', 'source' => 'https://dam.destination.one/849917/279ac45b3fc701a7197131f627164fffd9f8cc77bc75165e2fc2b864ed606920/theater-rudolstadt_johannes-gei-er_photo-by-lisa-stern_web_-jpg.jpg', + 'copyright' => 'Max Mustermann', ], [ 'uid' => 2, @@ -94,6 +95,7 @@ return [ 'alternative' => 'Description of Tueftlerzeit', 'creator_tool' => 'destination.one', 'source' => 'https://dam.destination.one/828118/f13bbf5602ffc406ebae2faa3527654dea84194666bce4925a1ca8bd3f50c5e9/tueftlerzeit-sfz-rudolstadt-jpg.jpg', + 'copyright' => '', ], [ 'uid' => 3, @@ -104,6 +106,7 @@ return [ 'alternative' => '', 'creator_tool' => 'destination.one', 'source' => 'https://dam.destination.one/853436/109ac1cf87913e21b5e2b0ef0cc63d223a14374364952a855746a8e7c3fcfc36/lutherkirche-jpg.jpg', + 'copyright' => '', ], ], ]; diff --git a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesUpdatesExistingImage.php b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesUpdatesExistingImage.php index ac102f4..d452f4c 100644 --- a/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesUpdatesExistingImage.php +++ b/Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImagesUpdatesExistingImage.php @@ -61,6 +61,7 @@ return [ 'alternative' => '', 'creator_tool' => 'destination.one', 'source' => 'https://dam.destination.one/849917/279ac45b3fc701a7197131f627164fffd9f8cc77bc75165e2fc2b864ed606920/theater-rudolstadt_johannes-gei-er_photo-by-lisa-stern_web_-jpg.jpg', + 'copyright' => 'Max Mustermann', ], [ 'uid' => 2, @@ -71,6 +72,7 @@ return [ 'alternative' => 'Description of Tueftlerzeit', 'creator_tool' => 'destination.one', 'source' => 'https://dam.destination.one/828118/f13bbf5602ffc406ebae2faa3527654dea84194666bce4925a1ca8bd3f50c5e9/tueftlerzeit-sfz-rudolstadt-jpg.jpg', + 'copyright' => '', ], ], ]; diff --git a/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/ImportHandlesImagesExistingData.php b/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/ImportHandlesImagesExistingData.php index 2d6eaa6..474ba1a 100644 --- a/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/ImportHandlesImagesExistingData.php +++ b/Tests/Functional/Import/DestinationDataTest/Fixtures/Database/ImportHandlesImagesExistingData.php @@ -65,6 +65,7 @@ return [ 'title' => 'Theater-Rudolstadt_Johannes-Geißer_photo-by-Lisa-Stern_web_.jpg', 'description' => '', 'alternative' => '', + 'copyright' => 'John Doe', ], [ 'uid' => 2, @@ -73,6 +74,7 @@ return [ 'title' => 'Tueftlerzeit©SFZ-Rudolstadt.jpg', 'description' => 'Description of Tueftlerzeit', 'alternative' => 'Description of Tueftlerzeit', + 'copyright' => 'Max Mustermann' ], ], 'tx_events_domain_model_event' => [ diff --git a/Tests/Functional/Import/DestinationDataTest/Fixtures/ResponseWithMultipleImagesForSingleEvent.json b/Tests/Functional/Import/DestinationDataTest/Fixtures/ResponseWithMultipleImagesForSingleEvent.json index 5558c03..dda6c06 100644 --- a/Tests/Functional/Import/DestinationDataTest/Fixtures/ResponseWithMultipleImagesForSingleEvent.json +++ b/Tests/Functional/Import/DestinationDataTest/Fixtures/ResponseWithMultipleImagesForSingleEvent.json @@ -81,7 +81,8 @@ "longitude": null, "width": 1920, "height": 1080, - "value": "Theater-Rudolstadt_Johannes-Geißer_photo-by-Lisa-Stern_web_.jpg" + "value": "Theater-Rudolstadt_Johannes-Geißer_photo-by-Lisa-Stern_web_.jpg", + "source": "Max Mustermann" }, { "rel": "default", diff --git a/Tests/Functional/Import/DestinationDataTest/Fixtures/ResponseWithNewImages.json b/Tests/Functional/Import/DestinationDataTest/Fixtures/ResponseWithNewImages.json index b6be236..452066a 100644 --- a/Tests/Functional/Import/DestinationDataTest/Fixtures/ResponseWithNewImages.json +++ b/Tests/Functional/Import/DestinationDataTest/Fixtures/ResponseWithNewImages.json @@ -81,7 +81,8 @@ "longitude": null, "width": 1920, "height": 1080, - "value": "Theater-Rudolstadt_Johannes-Geißer_photo-by-Lisa-Stern_web_.jpg" + "value": "Theater-Rudolstadt_Johannes-Geißer_photo-by-Lisa-Stern_web_.jpg", + "source": "Max Mustermann" } ], "keywords": [], diff --git a/ext_emconf.php b/ext_emconf.php index 35270d9..13bc675 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -9,7 +9,7 @@ $EM_CONF['events'] = [ 'state' => 'stable', 'createDirs' => '', 'clearCacheOnLoad' => 0, - 'version' => '3.5.2', + 'version' => '3.6.0', 'constraints' => [ 'depends' => [ 'typo3' => '10.4.00-11.5.99',