[TASK] Move TYPO3/CMS/Core/QueryGenerator into EXT:lowlevel 55/49855/5
authorFrank Naegler <frank.naegler@typo3.org>
Sun, 4 Sep 2016 09:44:42 +0000 (11:44 +0200)
committerBenni Mack <benni@typo3.org>
Sun, 4 Sep 2016 10:10:49 +0000 (12:10 +0200)
This patch moves TYPO3/CMS/Core/QueryGenerator into EXT:lowlevel, rename
the module and deprecate the old module.

Resolves: #77839
Releases: master
Change-Id: I96612719d89a4f8b5a194f99eecb9e341a9d7295
Reviewed-on: https://review.typo3.org/49855
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Bamboo TYPO3com <info@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/core/Documentation/Changelog/master/Deprecation-77839-MoveTYPO3CMSCoreQueryGeneratorIntoEXTlowlevelAndDeprecateTheOldModule.rst [new file with mode: 0644]
typo3/sysext/core/Resources/Public/JavaScript/QueryGenerator.js
typo3/sysext/lowlevel/Classes/View/DatabaseIntegrityView.php
typo3/sysext/lowlevel/Resources/Public/JavaScript/QueryGenerator.js [new file with mode: 0644]

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-77839-MoveTYPO3CMSCoreQueryGeneratorIntoEXTlowlevelAndDeprecateTheOldModule.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-77839-MoveTYPO3CMSCoreQueryGeneratorIntoEXTlowlevelAndDeprecateTheOldModule.rst
new file mode 100644 (file)
index 0000000..625eec0
--- /dev/null
@@ -0,0 +1,25 @@
+=======================================================================================================
+Deprecation: #77839 - Move TYPO3/CMS/Core/QueryGenerator into EXT:lowlevel and deprecate the old module
+=======================================================================================================
+
+Description
+===========
+
+The AMD module :javascript:`TYPO3/CMS/Core/QueryGenerator` have been deprecated.
+The module have been renamed to :javascript:`TYPO3/CMS/Lowlevel/QueryGenerator` and moved into EXT:lowlevel.
+
+Impact
+======
+
+Using the module will trigger a deprecation log message in the browser console.
+
+Affected Installations
+======================
+
+Any TYPO3 installation using custom calls to :javascript:`TYPO3/CMS/Core/QueryGenerator`
+
+
+Migration
+=========
+
+Use AMD module :javascript:`TYPO3/CMS/Lowlevel/QueryGenerator` instead.
index d9270e5..9d9ebce 100644 (file)
 /**
  * Module: TYPO3/CMS/Core/QueryGenerator
  * This module handle the QueryGenerator forms.
+ * @deprecated since TYPO3 v8, will be removed in TYPO3 v9
  */
-define(['jquery', 'TYPO3/CMS/Backend/DateTimePicker', 'TYPO3/CMS/Backend/jquery.clearable'], function ($) {
-
-       /**
-        * The QueryGenerator AMD module
-        *
-        * @type {{form: null, limitField: null}}
-        * @exports TYPO3/CMS/Core/QueryGenerator
-        */
-       var QueryGenerator = {
-               form: null,
-               limitField: null
-       };
-
-       /**
-        * Initialize the QueryGenerator object
-        */
-       QueryGenerator.initialize = function() {
-               QueryGenerator.form = $('form[name="queryform"]');
-               QueryGenerator.limitField = $('#queryLimit');
-               QueryGenerator.form.on('click', '.t3js-submit-click', function(e) {
-                       e.preventDefault();
-                       QueryGenerator.doSubmit();
-               });
-               QueryGenerator.form.on('change', '.t3js-submit-change', function(e) {
-                       e.preventDefault();
-                       QueryGenerator.doSubmit();
-               });
-               QueryGenerator.form.on('click', '.t3js-limit-submit button', function(e) {
-                       e.preventDefault();
-                       QueryGenerator.setLimit($(this).data('value'));
-                       QueryGenerator.doSubmit();
-               });
-               QueryGenerator.form.on('click', '.t3js-addfield', function(e) {
-                       e.preventDefault();
-                       QueryGenerator.addValueToField($(this).data('field'), $(this).val());
-               });
-               QueryGenerator.form.find('.t3js-clearable').clearable({
-                       onClear: function() {
-                               QueryGenerator.doSubmit();
-                       }
-               });
-       };
-
-       /**
-        * Submit the form
-        */
-       QueryGenerator.doSubmit = function() {
-               QueryGenerator.form.submit();
-       };
-
-       /**
-        * Set query limit
-        *
-        * @param {String} value
-        */
-       QueryGenerator.setLimit = function(value) {
-               QueryGenerator.limitField.val(value);
-       };
-
-       /**
-        * Add value to text field
-        *
-        * @param {String} field the name of the field
-        * @param {String} value the value to add
-        */
-       QueryGenerator.addValueToField = function(field, value) {
-               var $target = QueryGenerator.form.find('[name="' + field + '"]');
-               var currentValue = $target.val();
-               $target.val(currentValue + ',' + value);
-       };
-
-       // Initialize
-       QueryGenerator.initialize();
+define(['jquery', 'TYPO3/CMS/Lowlevel/QueryGenerator'], function ($, QueryGenerator) {
+       console.log('TYPO3/CMS/Core/QueryGenerator has been marked as deprecated since TYPO3 v8, will be removed in TYPO3 v9. Please use TYPO3/CMS/Lowlevel/QueryGenerator instead');
        return QueryGenerator;
 });
index 644e12f..c53b51c 100644 (file)
@@ -353,7 +353,7 @@ class DatabaseIntegrityView extends BaseScriptClass
         $this->view->assign('searchMode', $searchMode);
         switch ($searchMode) {
             case 'query':
-                $this->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Core/QueryGenerator');
+                $this->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Lowlevel/QueryGenerator');
                 $this->view->assign('queryMaker', $fullsearch->queryMaker());
                 break;
             case 'raw':
diff --git a/typo3/sysext/lowlevel/Resources/Public/JavaScript/QueryGenerator.js b/typo3/sysext/lowlevel/Resources/Public/JavaScript/QueryGenerator.js
new file mode 100644 (file)
index 0000000..424a53f
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+/**
+ * Module: TYPO3/CMS/Lowlevel/QueryGenerator
+ * This module handle the QueryGenerator forms.
+ */
+define(['jquery', 'TYPO3/CMS/Backend/DateTimePicker', 'TYPO3/CMS/Backend/jquery.clearable'], function ($) {
+
+       /**
+        * The QueryGenerator AMD module
+        *
+        * @type {{form: null, limitField: null}}
+        * @exports TYPO3/CMS/Lowlevel/QueryGenerator
+        */
+       var QueryGenerator = {
+               form: null,
+               limitField: null
+       };
+
+       /**
+        * Initialize the QueryGenerator object
+        */
+       QueryGenerator.initialize = function() {
+               QueryGenerator.form = $('form[name="queryform"]');
+               QueryGenerator.limitField = $('#queryLimit');
+               QueryGenerator.form.on('click', '.t3js-submit-click', function(e) {
+                       e.preventDefault();
+                       QueryGenerator.doSubmit();
+               });
+               QueryGenerator.form.on('change', '.t3js-submit-change', function(e) {
+                       e.preventDefault();
+                       QueryGenerator.doSubmit();
+               });
+               QueryGenerator.form.on('click', '.t3js-limit-submit button', function(e) {
+                       e.preventDefault();
+                       QueryGenerator.setLimit($(this).data('value'));
+                       QueryGenerator.doSubmit();
+               });
+               QueryGenerator.form.on('click', '.t3js-addfield', function(e) {
+                       e.preventDefault();
+                       QueryGenerator.addValueToField($(this).data('field'), $(this).val());
+               });
+               QueryGenerator.form.find('.t3js-clearable').clearable({
+                       onClear: function() {
+                               QueryGenerator.doSubmit();
+                       }
+               });
+       };
+
+       /**
+        * Submit the form
+        */
+       QueryGenerator.doSubmit = function() {
+               QueryGenerator.form.submit();
+       };
+
+       /**
+        * Set query limit
+        *
+        * @param {String} value
+        */
+       QueryGenerator.setLimit = function(value) {
+               QueryGenerator.limitField.val(value);
+       };
+
+       /**
+        * Add value to text field
+        *
+        * @param {String} field the name of the field
+        * @param {String} value the value to add
+        */
+       QueryGenerator.addValueToField = function(field, value) {
+               var $target = QueryGenerator.form.find('[name="' + field + '"]');
+               var currentValue = $target.val();
+               $target.val(currentValue + ',' + value);
+       };
+
+       // Initialize
+       QueryGenerator.initialize();
+       return QueryGenerator;
+});