[BUGFIX] Do not submit forms for link attributes in LinkBrowser 11/44711/2
authorMarkus Klein <markus.klein@typo3.org>
Fri, 13 Nov 2015 20:18:49 +0000 (21:18 +0100)
committerMorton Jonuschat <m.jonuschat@mojocode.de>
Fri, 13 Nov 2015 20:25:38 +0000 (21:25 +0100)
Resolves: #71520
Releases: master
Change-Id: I033b661be263a5e7c5c090c419c451a79f13f96e
Reviewed-on: https://review.typo3.org/44711
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
typo3/sysext/recordlist/Classes/Controller/AbstractLinkBrowserController.php
typo3/sysext/recordlist/Resources/Public/JavaScript/LinkBrowser.js
typo3/sysext/rtehtmlarea/Classes/Controller/BrowseLinksController.php

index b7b6c0b..270a522 100644 (file)
@@ -502,7 +502,7 @@ abstract class AbstractLinkBrowserController
                        <!--
                                Selecting target for link:
                        -->
-                               <form action="" name="ltargetform" id="ltargetform">
+                               <form action="" name="ltargetform" id="ltargetform" class="t3js-dummyform">
                                        <table border="0" cellpadding="2" cellspacing="1" id="typo3-linkTarget">
                                                <tr>
                                                        <td style="width: 96px;">' . $lang->getLL('target', true) . ':</td>
@@ -522,7 +522,7 @@ abstract class AbstractLinkBrowserController
                                <!--
                                        Selecting title for link:
                                -->
-                               <form action="" name="ltitleform" id="ltitleform">
+                               <form action="" name="ltitleform" id="ltitleform" class="t3js-dummyform">
                                        <table border="0" cellpadding="2" cellspacing="1" id="typo3-linkTitle">
                                                <tr>
                                                        <td style="width: 96px;">' . $lang->getLL('title', true) . '</td>
@@ -536,7 +536,7 @@ abstract class AbstractLinkBrowserController
                                <!--
                                        Selecting class for link:
                                -->
-                               <form action="" name="lclassform" id="lclassform">
+                               <form action="" name="lclassform" id="lclassform" class="t3js-dummyform">
                                        <table border="0" cellpadding="2" cellspacing="1" id="typo3-linkClass">
                                                <tr>
                                                        <td style="width: 96px;">' . $lang->getLL('class', true) . '</td>
@@ -550,7 +550,7 @@ abstract class AbstractLinkBrowserController
                                <!--
                                        Selecting params for link:
                                -->
-                               <form action="" name="lparamsform" id="lparamsform">
+                               <form action="" name="lparamsform" id="lparamsform" class="t3js-dummyform">
                                        <table border="0" cellpadding="2" cellspacing="1" id="typo3-linkParams">
                                                <tr>
                                                        <td style="width: 96px;">' . $lang->getLL('params', true) . '</td>
index 0e2c47c..93e1f6a 100644 (file)
@@ -116,6 +116,7 @@ define(['jquery'], function($) {
                LinkBrowser.linkAttributeFields = data.linkAttributeFields;
 
                $('.t3js-targetPreselect').on('change', LinkBrowser.loadTarget);
+               $('form.t3js-dummyform').on('submit', function(evt) { evt.preventDefault(); });
        });
 
        /**
index 320eb88..4802e5f 100644 (file)
@@ -431,7 +431,7 @@ class BrowseLinksController extends AbstractLinkBrowserController
             : '';
         // @todo define label "linkRelationship" below in xlf
         return '
-                               <form action="" name="lrelform" id="lrelform">
+                               <form action="" name="lrelform" id="lrelform" class="t3js-dummyform">
                                        <table border="0" cellpadding="2" cellspacing="1" id="typo3-linkRel">
                                                <tr>
                                                        <td><label>' . $this->getLanguageService()->getLL('linkRelationship', true) . ':</label></td>
@@ -468,7 +468,7 @@ class BrowseLinksController extends AbstractLinkBrowserController
         }
 
         return '
-                               <form action="" name="ltargetform" id="ltargetform">
+                               <form action="" name="ltargetform" id="ltargetform" class="t3js-dummyform">
                                        <table border="0" cellpadding="2" cellspacing="1" id="typo3-linkTarget">
                                                <tr' . ($targetSelectorConfig['disabled'] ? ' style="display: none;"' : '') . '>
                                                        <td style="width: 96px;">' . $lang->getLL('target', true) . ':</td>
@@ -512,7 +512,7 @@ class BrowseLinksController extends AbstractLinkBrowserController
                 : $this->classesAnchorDefaultTitle[$this->currentLinkHandlerId];
         }
         return '
-                               <form action="" name="ltitleform" id="ltitleform">
+                               <form action="" name="ltitleform" id="ltitleform" class="t3js-dummyform">
                                        <table border="0" cellpadding="2" cellspacing="1" id="typo3-linkTitle">
                                                <tr>
                                                        <td style="width: 96px;"><label for="rtehtmlarea-browse-links-anchor_title" id="rtehtmlarea-browse-links-title-label">' . $this->getLanguageService()->getLL('anchor_title', true) . '</label></td>
@@ -538,7 +538,7 @@ class BrowseLinksController extends AbstractLinkBrowserController
         $selectClass = '';
         if ($this->classesAnchorJSOptions[$this->currentLinkHandlerId]) {
             $selectClass = '
-                               <form action="" name="lclassform" id="lclassform">
+                               <form action="" name="lclassform" id="lclassform" class="t3js-dummyform">
                                        <table border="0" cellpadding="2" cellspacing="1" id="typo3-linkClass">
                                                <tr>
                                                        <td style="width: 96px;">' . $this->getLanguageService()->getLL('anchor_class', true) . '</td>