[TASK] Drop option mod.web_list.newWizards and use new modal CE wizard 46/56346/4
authorChristian Kuhn <lolli@schwarzbu.ch>
Sun, 18 Mar 2018 09:51:48 +0000 (10:51 +0100)
committerAndreas Wolf <andreas.wolf@typo3.org>
Sun, 18 Mar 2018 10:51:53 +0000 (11:51 +0100)
Enabled PageTsConfig option 'mod.web_list.newWizards' by default,
drop that option and link to the new content element wizard that
is displayed in a modal.

Resolves: #84463
Releases: master
Change-Id: Idb3a2b5e108426e976c560021b302f6f84dffd72
Reviewed-on: https://review.typo3.org/56346
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Wolf <andreas.wolf@typo3.org>
Tested-by: Andreas Wolf <andreas.wolf@typo3.org>
typo3/sysext/core/Documentation/Changelog/master/Deprecation-84463-PageTsConfigOptionModweb_listnewWizardsDropped.rst [new file with mode: 0644]
typo3/sysext/install/Configuration/ExtensionScanner/Php/PropertyProtectedMatcher.php
typo3/sysext/recordlist/Classes/Controller/RecordListController.php
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-84463-PageTsConfigOptionModweb_listnewWizardsDropped.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-84463-PageTsConfigOptionModweb_listnewWizardsDropped.rst
new file mode 100644 (file)
index 0000000..8f08bbf
--- /dev/null
@@ -0,0 +1,41 @@
+.. include:: ../../Includes.txt
+
+=========================================================================
+Deprecation: #84463 - PageTsConfig option mod.web_list.newWizards dropped
+=========================================================================
+
+See :issue:`84463`
+
+Description
+===========
+
+The widely unknown PageTsConfig option :ts:`mod.web_list.newWizards` has
+been enabled by default and dropped.
+
+PHP property :php:`newWizards` of class :php:`TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList`
+has been deprecated along the way.
+
+
+Impact
+======
+
+The "+" sign in the list module of `pages` table now by default links to the wizard
+to select the new page position.
+
+The "+" sign in the list module of `tt_content` table now by default links to the
+new content element wizard in a modal.
+
+
+Affected Installations
+======================
+
+Most installations should not be affected by the code change, the extension scanner
+will find extensions using the mentioned class property.
+
+
+Migration
+=========
+
+Do not use property :php:`newWizards` anymore, drop the PageTsConfig option if used.
+
+.. index:: Backend, PHP-API, TSConfig, PartiallyScanned
\ No newline at end of file
index b50dbbc..2403c9b 100644 (file)
@@ -547,4 +547,9 @@ return [
             'Deprecation-84338-ProtectedMethodsAndPropertiesInTableController.rst',
         ],
     ],
+    'TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList->newWizards' => [
+        'restFiles' => [
+            'Deprecation-84463-PageTsConfigOptionModweb_listnewWizardsDropped.rst',
+        ],
+    ],
 ];
index 2d42972..93cdfd8 100644 (file)
@@ -327,7 +327,6 @@ class RecordListController
         $dblist->tableTSconfigOverTCA = $this->modTSconfig['properties']['table.'];
         $dblist->allowedNewTables = GeneralUtility::trimExplode(',', $this->modTSconfig['properties']['allowedNewTables'], true);
         $dblist->deniedNewTables = GeneralUtility::trimExplode(',', $this->modTSconfig['properties']['deniedNewTables'], true);
-        $dblist->newWizards = $this->modTSconfig['properties']['newWizards'] ? 1 : 0;
         $dblist->pageRow = $this->pageinfo;
         $dblist->counter++;
         $dblist->MOD_MENU = ['bigControlPanel' => '', 'clipBoard' => ''];
index 195e283..72d5298 100644 (file)
@@ -24,6 +24,7 @@ use TYPO3\CMS\Backend\Template\ModuleTemplate;
 use TYPO3\CMS\Backend\Tree\View\PageTreeView;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
+use TYPO3\CMS\Core\Compatibility\PublicPropertyDeprecationTrait;
 use TYPO3\CMS\Core\Database\Connection;
 use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\Database\Query\QueryBuilder;
@@ -53,6 +54,15 @@ use TYPO3\CMS\Frontend\Page\PageRepository;
  */
 class DatabaseRecordList
 {
+    use PublicPropertyDeprecationTrait;
+
+    /**
+     * @var array
+     */
+    protected $deprecatedPublicProperties = [
+        'newWizards' => 'Using $newWizards of class DatabaseRecordList from outside is discouraged, property will be removed in v10.',
+    ];
+
     // *********
     // External:
     // *********
@@ -75,10 +85,11 @@ class DatabaseRecordList
 
     /**
      * If TRUE, the control panel will contain links to the create-new wizards for
-     * pages and tt_content elements (normally, the link goes to just creatinga new
+     * pages and tt_content elements (normally, the link goes to just creating a new
      * element without the wizards!).
      *
      * @var bool
+     * @deprecated and unused since v9, will be removed in v10
      */
     public $newWizards = false;
 
@@ -1661,16 +1672,23 @@ class DatabaseRecordList
                             $spriteIcon = $table === 'pages'
                                 ? $this->iconFactory->getIcon('actions-page-new', Icon::SIZE_SMALL)
                                 : $this->iconFactory->getIcon('actions-add', Icon::SIZE_SMALL);
-                            if ($table === 'tt_content' && $this->newWizards) {
+                            if ($table === 'tt_content') {
                                 // If mod.newContentElementWizard.override is set, use that extension's create new content wizard instead:
                                 $tmpTSc = BackendUtility::getModTSconfig($this->pageinfo['uid'], 'mod');
-                                $newContentElementWizard = $tmpTSc['properties']['newContentElementWizard.']['override'] ?? 'new_content_element';
-                                $newContentWizScriptPath = (string)$uriBuilder->buildUriFromRoute($newContentElementWizard, ['id' => $this->id]);
-
-                                $onClick = 'return jumpExt(' . GeneralUtility::quoteJSvalue($newContentWizScriptPath) . ');';
-                                $icon = '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars($onClick) . '" title="'
-                                    . htmlspecialchars($lang->getLL('new')) . '">' . $spriteIcon->render() . '</a>';
-                            } elseif ($table === 'pages' && $this->newWizards) {
+                                $newContentElementWizard = $tmpTSc['properties']['newContentElementWizard.']['override'] ?? 'new_content_element_wizard';
+                                $url = (string)$uriBuilder->buildUriFromRoute(
+                                    $newContentElementWizard,
+                                    [
+                                        'id' => $this->id,
+                                        'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI'),
+                                    ]
+                                );
+                                $icon = '<a href="#" data-url="' . htmlspecialchars($url) . '" '
+                                    . 'data-title="' . htmlspecialchars($lang->getLL('new')) . '"'
+                                    . 'class="btn btn-default t3js-toggle-new-content-element-wizard">'
+                                    . $spriteIcon->render()
+                                    . '</a>';
+                            } elseif ($table === 'pages') {
                                 $parameters = ['id' => $this->id, 'pagesOnly' => 1, 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')];
                                 $href = (string)$uriBuilder->buildUriFromRoute('db_new', $parameters);
                                 $icon = '<a class="btn btn-default" href="' . htmlspecialchars($href) . '" title="' . htmlspecialchars($lang->getLL('new')) . '">'