Skip to content

Commit

Permalink
[BUGFIX] Prevent TypeError in file related webhook messages
Browse files Browse the repository at this point in the history
Since FileInterface->getPublicUrl() might return
`NULL`, corresponding constructor arguments are
updated to now expect `?string`.

Resolves: #103051
Releases: main, 12.4
Change-Id: I8d16c6b9361694733dc2c5c4b2e69693fe25cff4
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83011
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Andreas Kienast <a.fernandez@scripting-base.de>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Oliver Klee <typo3-coding@oliverklee.de>
Tested-by: Andreas Kienast <a.fernandez@scripting-base.de>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
Tested-by: Oliver Bartsch <bo@cedev.de>
  • Loading branch information
o-ba committed Feb 16, 2024
1 parent 488076f commit 19c5f9b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion typo3/sysext/webhooks/Classes/Message/FileAddedMessage.php
Expand Up @@ -35,7 +35,7 @@ final class FileAddedMessage implements WebhookMessageInterface
public function __construct(
private readonly int $storageUid,
private readonly string $identifier,
private readonly string $publicUrl
private readonly ?string $publicUrl
) {}

public static function createFromEvent(AfterFileAddedEvent $event): self
Expand Down
Expand Up @@ -35,7 +35,7 @@ final class FileRemovedMessage implements WebhookMessageInterface
public function __construct(
private readonly int $storageUid,
private readonly string $identifier,
private readonly string $publicUrl
private readonly ?string $publicUrl
) {}

public static function createFromEvent(BeforeFileDeletedEvent $event): self
Expand Down
Expand Up @@ -33,7 +33,7 @@ final class FileUpdatedMessage implements WebhookMessageInterface
public function __construct(
private readonly int $storageUid,
private readonly string $identifier,
private readonly string $publicUrl,
private readonly ?string $publicUrl,
private readonly array $relevantProperties,
private readonly array $updatedFields
) {}
Expand Down

0 comments on commit 19c5f9b

Please sign in to comment.