[BUGFIX] Mark form as changed after using the image cropper 78/59178/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Sun, 16 Dec 2018 11:24:45 +0000 (12:24 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Mon, 17 Dec 2018 22:03:22 +0000 (23:03 +0100)
The image cropper now marks the form as "changed" after saving new
cropping information.

Change-Id: Icc387f0458c0dca9205b87fe58ed66190a4f869c
Resolves: #86998
Releases: master, 9.5, 8.7
Reviewed-on: https://review.typo3.org/59178
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/backend/Resources/Private/TypeScript/ImageManipulation.ts
typo3/sysext/backend/Resources/Public/JavaScript/ImageManipulation.js

index 56846c2..e9e890a 100644 (file)
  */
 
 /// <amd-dependency path='TYPO3/CMS/Core/Contrib/imagesloaded.pkgd.min' name='ImagesLoaded'>
+/// <amd-dependency path='TYPO3/CMS/Backend/FormEngineValidation' name='FormEngineValidation'>
 /// <amd-dependency path='TYPO3/CMS/Backend/Icons' name='Icons'>
 /// <amd-dependency path='TYPO3/CMS/Backend/Modal' name='Modal'>
 
 import $ = require('jquery');
 import 'jquery-ui/draggable';
 import 'jquery-ui/resizable';
+declare const FormEngineValidation: any;
 declare const Icons: any;
 declare const Modal: any;
 declare const ImagesLoaded: any;
@@ -952,6 +954,7 @@ class ImageManipulation {
     this.trigger.attr('data-crop-variants', JSON.stringify(data));
     this.setPreviewImages(data);
     hiddenField.val(cropVariants);
+    FormEngineValidation.markFieldAsChanged(hiddenField);
     this.currentModal.modal('hide');
   }
 
index 53e6397..8d17655 100644 (file)
@@ -10,7 +10,7 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require", "exports", "TYPO3/CMS/Core/Contrib/imagesloaded.pkgd.min", "TYPO3/CMS/Backend/Icons", "TYPO3/CMS/Backend/Modal", "jquery", "jquery-ui/draggable", "jquery-ui/resizable"], function (require, exports, ImagesLoaded, Icons, Modal, $) {
+define(["require", "exports", "TYPO3/CMS/Core/Contrib/imagesloaded.pkgd.min", "TYPO3/CMS/Backend/FormEngineValidation", "TYPO3/CMS/Backend/Icons", "TYPO3/CMS/Backend/Modal", "jquery", "jquery-ui/draggable", "jquery-ui/resizable"], function (require, exports, ImagesLoaded, FormEngineValidation, Icons, Modal, $) {
     "use strict";
     /**
      * Module: TYPO3/CMS/Backend/ImageManipulation
@@ -792,6 +792,7 @@ define(["require", "exports", "TYPO3/CMS/Core/Contrib/imagesloaded.pkgd.min", "T
             this.trigger.attr('data-crop-variants', JSON.stringify(data));
             this.setPreviewImages(data);
             hiddenField.val(cropVariants);
+            FormEngineValidation.markFieldAsChanged(hiddenField);
             this.currentModal.modal('hide');
         };
         /**