Skip to content

Commit

Permalink
[BUGFIX] Set actionName for adding online media
Browse files Browse the repository at this point in the history
The property `actionName` is added to the window message to allow adding
media from the "Add media by URL" again. To prevent such issues in
future, a new interface is introduced which renders `actionName`
mandatory.

Resolves: #90626
Releases: master
Change-Id: I925da0476f2f29bd9394c723369b68429e59b545
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63538
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Christian Eßl <indy.essl@gmail.com>
Tested-by: Daniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Christian Eßl <indy.essl@gmail.com>
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
  • Loading branch information
andreaskienast authored and ervaude committed Mar 3, 2020
1 parent 2758aa4 commit a5f19ef
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class OnlineMedia {
(data: Response): void => {
if (data.file) {
const message = {
actionName: 'typo3:foreignRelation:inserted',
objectGroup: irreObjectUid,
table: 'sys_file',
uid: data.file,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
* The TYPO3 project - inspiring people to share!
*/

interface Message {
actionName: string;
[key: string]: any;
}

export class MessageUtility {
/**
* Generates an URL for usage in postMessage
Expand All @@ -34,7 +39,7 @@ export class MessageUtility {
* @param {*} message
* @param {Window} windowObject
*/
public static send(message: any, windowObject: Window = window): void {
public static send(message: Message, windowObject: Window = window): void {
windowObject.postMessage(message, MessageUtility.getOrigin());
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a5f19ef

Please sign in to comment.