-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle destination.one files without file name.
It is possible to have files such as `https://dam.destination.one/2675868/3dc0a9dccd0dad46c73e669ece428c634ff8324ea3d01a4858a1c43169deed41/.jpg`. Those were not handled correctly yet. We now also handle those cases. We will generate a hash from the URL as file name in order to still use those files. Relates: #11396
- Loading branch information
1 parent
17fae72
commit 404b5ae
Showing
5 changed files
with
177 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
Tests/Functional/Import/DestinationDataTest/Assertions/ImportHandlesImageWithoutFileName.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use TYPO3\CMS\Core\Resource\File; | ||
|
||
return [ | ||
'sys_file' => [ | ||
[ | ||
'uid' => 1, | ||
'pid' => 0, | ||
'missing' => 0, | ||
'storage' => 1, | ||
'type' => File::FILETYPE_IMAGE, | ||
'identifier' => '/staedte/beispielstadt/events/bf126089c94f95031fa07bf9d7d9b10c3e58aafebdef31f0b60604da13019b8d.jpg', | ||
'extension' => 'jpg', | ||
'name' => 'bf126089c94f95031fa07bf9d7d9b10c3e58aafebdef31f0b60604da13019b8d.jpg', | ||
], | ||
], | ||
'sys_file_reference' => [ | ||
[ | ||
'uid' => 1, | ||
'pid' => 2, | ||
'uid_local' => 1, | ||
'uid_foreign' => 1, | ||
'tablenames' => 'tx_events_domain_model_event', | ||
'fieldname' => 'images', | ||
'sorting_foreign' => 1, | ||
'title' => null, | ||
'description' => null, | ||
'alternative' => null, | ||
], | ||
], | ||
'sys_file_metadata' => [ | ||
[ | ||
'uid' => 1, | ||
'pid' => 0, | ||
'file' => 1, | ||
'title' => null, | ||
], | ||
], | ||
]; |
77 changes: 77 additions & 0 deletions
77
...s/Functional/Import/DestinationDataTest/Fixtures/ResponseWithNewImageWithoutFileName.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
{ | ||
"status": "OK", | ||
"count": 3, | ||
"overallcount": 50, | ||
"channels": [], | ||
"facetGroups": [], | ||
"items": [ | ||
{ | ||
"global_id": "e_100347853", | ||
"id": "100347853", | ||
"title": "Allerlei Weihnachtliches (Heute mit Johannes Geißer)", | ||
"type": "Event", | ||
"categories": [ | ||
"Weihnachten" | ||
], | ||
"texts": [ | ||
{ | ||
"rel": "details", | ||
"type": "text/html", | ||
"value": "Die Lichter sind entzündet, die Plätzchen duften, man rückt endlich wieder näher zusammen und lauscht den Geschichten. Vier Schauspieler*innen unseres Theaters überraschen mit ihren weihnachtlichen Texten, die sie für uns ausgewählt haben. Dazu plaudern sie über persönliche Anekdoten und erinnern sich an ihre schönsten und verrücktesten Weihnachtsfeste. Und da der Genuss in der Vorweihnachtszeit nicht fehlen darf, wird an jedem Adventssonntag eine andere weihnachtliche Spezialität serviert.<br>Eintritt: 10 € (inkl. Gedeck mit weihnachtlicher Schillerlocke)<br>Um Voranmeldung unter 03672-486470 oder <a data-cke-saved-href=\"mailto:[email protected]\" href=\"mailto:[email protected]\">[email protected]</a> wird gebeten. <br><strong>Es gilt die 2G-PLUS-Regel.</strong> <br>" | ||
}, | ||
{ | ||
"rel": "details", | ||
"type": "text/plain", | ||
"value": "Die Lichter sind entzündet, die Plätzchen duften, man rückt endlich wieder näher zusammen und lauscht den Geschichten. Vier Schauspieler*innen unseres Theaters überraschen mit ihren weihnachtlichen Texten, die sie für uns ausgewählt haben. Dazu plaudern sie über persönliche Anekdoten und erinnern sich an ihre schönsten und verrücktesten Weihnachtsfeste. Und da der Genuss in der Vorweihnachtszeit nicht fehlen darf, wird an jedem Adventssonntag eine andere weihnachtliche Spezialität serviert.\nEintritt: 10 € (inkl. Gedeck mit weihnachtlicher Schillerlocke)\nUm Voranmeldung unter 03672-486470 oder [email protected] wird gebeten.\nEs gilt die 2G-PLUS-Regel." | ||
}, | ||
{ | ||
"rel": "teaser", | ||
"type": "text/html" | ||
}, | ||
{ | ||
"rel": "teaser", | ||
"type": "text/plain" | ||
} | ||
], | ||
"areas": [ | ||
"Rudolstadt und Umgebung" | ||
], | ||
"city": "Rudolstadt", | ||
"zip": "07407", | ||
"street": "Schillerstraße 25", | ||
"phone": "+ 49 3672 / 486470", | ||
"fax": "+ 49 3672 / 486475", | ||
"web": "http://www.schillerhaus.rudolstadt.de/", | ||
"email": "[email protected]", | ||
"author": "[email protected]", | ||
"media_objects": [ | ||
{ | ||
"rel": "default", | ||
"url": "https://dam.destination.one/849917/279ac45b3fc701a7197131f627164fffd9f8cc77bc75165e2fc2b864ed606920/.jpg", | ||
"type": "image/jpeg", | ||
"latitude": null, | ||
"longitude": null, | ||
"width": 1920, | ||
"height": 1080, | ||
"value": "" | ||
} | ||
], | ||
"timeIntervals": [ | ||
{ | ||
"weekdays": [], | ||
"start": "2022-12-19T15:00:00+01:00", | ||
"end": "2022-12-19T16:30:00+01:00", | ||
"tz": "Europe/Berlin", | ||
"interval": 1 | ||
} | ||
], | ||
"name": "Schillerhaus Rudolstadt", | ||
"created": "2022-10-31T12:29:00+00:00", | ||
"changed": "2022-12-14T08:29:00+00:00", | ||
"source": { | ||
"url": "http://destination.one/", | ||
"value": "destination.one" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters