[BUGFIX] Re-allow t3d export from ID 0 47/47347/4
authorBenni Mack <benni@typo3.org>
Mon, 21 Mar 2016 19:24:01 +0000 (20:24 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 22 Mar 2016 13:22:59 +0000 (14:22 +0100)
During the refactoring of the impexp module a check for the
page ID was introduced to show the pagetree and additional
fields only if a page ID was given, which disallows to export
records on ID 0.

Additionally, a minor JavaScript bug which popped up then
is fixed as well.

Resolves: #75183
Releases: master, 7.6
Change-Id: I0adbd933ecc5da938b511d531178ac707cb035c3
Reviewed-on: https://review.typo3.org/47347
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/impexp/Resources/Private/Partials/Export/Configuration.html
typo3/sysext/impexp/Resources/Public/JavaScript/ImportExport.js

index 9b42c35..d0a2580 100644 (file)
@@ -1,56 +1,53 @@
 <html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
-<f:if condition="{inData.pagetree.id}">
-       <h3>
-               <f:translate key="makeconfig_exportPagetreeConfiguration" />
-               <f:be.buttons.csh table="xMOD_tx_impexp" field="pageTreeCfg" />
-       </h3>
-       <div class="row">
-               <div class="col-sm-2">
-                       <label class="control-label"><f:translate key="makeconfig_pageId" /></label>
-               </div>
-               <div class="col-sm-10">
-                       {inData.pagetree.id}
-                       <f:form.hidden value="{inData.pagetree.id}" name="tx_impexp[pagetree][id]" />
-               </div>
+<h3>
+       <f:translate key="makeconfig_exportPagetreeConfiguration" />
+       <f:be.buttons.csh table="xMOD_tx_impexp" field="pageTreeCfg" />
+</h3>
+<div class="row">
+       <div class="col-sm-2">
+               <label class="control-label"><f:translate key="makeconfig_pageId" /></label>
        </div>
-       <div class="row">
-               <div class="col-sm-2">
-                       <label class="control-label">
-                               <f:translate key="makeconfig_tree" />
-                               <f:be.buttons.csh table="xMOD_tx_impexp" field="pageTreeDisplay" />
-                       </label>
-               </div>
-               <div class="col-sm-10">
-                       <f:if condition="{treeHTML}">
-                               <f:then><f:format.raw>{treeHTML}</f:format.raw></f:then>
-                               <f:else><f:translate key="makeconfig_noTreeExportedOnly" /></f:else>
-                       </f:if>
-               </div>
+       <div class="col-sm-10">
+               {inData.pagetree.id}
                <f:form.hidden value="{inData.pagetree.id}" name="tx_impexp[pagetree][id]" />
        </div>
-       <div class="form-group">
-               <label for="impexp-pagetree-levels">
-                       <f:translate key="makeconfig_levels" />
-               </label>
-               <f:be.buttons.csh table="xMOD_tx_impexp" field="pageTreeMode" />
-               <f:form.select class="form-control" name="tx_impexp[pagetree][levels]" id="impexp-pagetree-levels" options="{levelSelectOptions}" value="{inData.pagetree.levels}" />
-       </div>
-       <div class="form-group">
-               <label for="impexp-pagetree-includetables">
-                       <f:translate key="makeconfig_includeTables" />
+</div>
+<div class="row">
+       <div class="col-sm-2">
+               <label class="control-label">
+                       <f:translate key="makeconfig_tree" />
+                       <f:be.buttons.csh table="xMOD_tx_impexp" field="pageTreeDisplay" />
                </label>
-               <f:be.buttons.csh table="xMOD_tx_impexp" field="pageTreeRecordLimit"/>
-               <f:form.select class="form-control" name="tx_impexp[pagetree][tables]" id="impexp-pagetree-includetables"
-                                                                        options="{tableSelectOptions}" multiple="multiple" value="{inData.pagetree.tables}"
-                                                                        size="{f:if(condition: '{tableSelectOptions -> f:count()} > 9', then: '10', else: '5')}" />
        </div>
-       <div class="form-group">
-               <label for="impexp-pagetree-maxnumber">
-                       <f:translate key="makeconfig_maxNumberOfRecords" />
-               </label>
-               <f:form.textfield class="form-control" name="tx_impexp[pagetree][maxNumber]" id="impexp-pagetree-maxnumber" value="{inData.pagetree.maxNumber}" />
+       <div class="col-sm-10">
+               <f:if condition="{treeHTML}">
+                       <f:then><f:format.raw>{treeHTML}</f:format.raw></f:then>
+                       <f:else><f:translate key="makeconfig_noTreeExportedOnly" /></f:else>
+               </f:if>
        </div>
-</f:if>
+</div>
+<div class="form-group">
+       <label for="impexp-pagetree-levels">
+               <f:translate key="makeconfig_levels" />
+       </label>
+       <f:be.buttons.csh table="xMOD_tx_impexp" field="pageTreeMode" />
+       <f:form.select class="form-control" name="tx_impexp[pagetree][levels]" id="impexp-pagetree-levels" options="{levelSelectOptions}" value="{inData.pagetree.levels}" />
+</div>
+<div class="form-group">
+       <label for="impexp-pagetree-includetables">
+               <f:translate key="makeconfig_includeTables" />
+       </label>
+       <f:be.buttons.csh table="xMOD_tx_impexp" field="pageTreeRecordLimit"/>
+       <f:form.select class="form-control" name="tx_impexp[pagetree][tables]" id="impexp-pagetree-includetables"
+                                                                options="{tableSelectOptions}" multiple="multiple" value="{inData.pagetree.tables}"
+                                                                size="{f:if(condition: '{tableSelectOptions -> f:count()} > 9', then: '10', else: '5')}" />
+</div>
+<div class="form-group">
+       <label for="impexp-pagetree-maxnumber">
+               <f:translate key="makeconfig_maxNumberOfRecords" />
+       </label>
+       <f:form.textfield class="form-control" name="tx_impexp[pagetree][maxNumber]" id="impexp-pagetree-maxnumber" value="{inData.pagetree.maxNumber}" />
+</div>
 <f:if condition="{records -> f:count()} > 0">
        <h4>
                <f:translate key="makeconfig_exportSingleRecord" />
index cc5f843..7dba828 100644 (file)
@@ -36,7 +36,9 @@ define(['jquery', 'TYPO3/CMS/Backend/Modal'], function ($, Modal) {
 
                $('.t3js-impexp-toggledisabled').on('click', function() {
                        var $checkboxes = $('table.t3js-impexp-preview tr[data-active="hidden"] input.t3js-exclude-checkbox');
-                       $checkboxes.prop('checked', !$checkboxes.get(0).checked);
+                       if ($checkboxes.length) {
+                               $checkboxes.prop('checked', !$checkboxes.get(0).checked);
+                       }
                });
        });
 });