From 3f9ab8220289ee8ff6fa1c879557853b87d151da Mon Sep 17 00:00:00 2001
From: Mathias Brodala <mbrodala@pagemachine.de>
Date: Fri, 22 Nov 2019 18:24:50 +0100
Subject: [PATCH] [FEATURE] Allow custom tables in form record browser
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Resolves: #89747
Releases: master
Change-Id: I5cf9038974813dab500934656b49c7a434596c35
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62386
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Björn Jacob <bjoern.jacob@tritum.de>
Tested-by: Ralf Zimmermann <ralf.zimmermann@tritum.de>
Reviewed-by: Susanne Moog <look@susi.dev>
Reviewed-by: Björn Jacob <bjoern.jacob@tritum.de>
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Ralf Zimmermann <ralf.zimmermann@tritum.de>
---
 ...7-CustomTablesWithRecordBrowserInForms.rst | 43 +++++++++++++++++++
 .../Backend/FormEditor/InspectorComponent.js  |  5 ---
 2 files changed, 43 insertions(+), 5 deletions(-)
 create mode 100644 typo3/sysext/core/Documentation/Changelog/master/Feature-89747-CustomTablesWithRecordBrowserInForms.rst

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-89747-CustomTablesWithRecordBrowserInForms.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-89747-CustomTablesWithRecordBrowserInForms.rst
new file mode 100644
index 000000000000..a6c3d75087c5
--- /dev/null
+++ b/typo3/sysext/core/Documentation/Changelog/master/Feature-89747-CustomTablesWithRecordBrowserInForms.rst
@@ -0,0 +1,43 @@
+.. include:: ../../Includes.txt
+
+============================================================
+Feature: #89747 - Custom tables with record browser in forms
+============================================================
+
+See :issue:`89747`
+
+Description
+===========
+
+The record browser in forms now accepts arbitrary custom tables if configured accordingly.
+
+The option :yaml:`browsableType` of the :yaml:`Inspector-Typo3WinBrowserEditor` can be set to an arbitrary table:
+
+.. code-block:: yaml
+
+   TYPO3:
+     CMS:
+       Form:
+         prototypes:
+           standard:
+             formElementsDefinition:
+               MyCustomElement:
+                 formEditor:
+                   editors:
+                     # ...
+                     300:
+                       identifier: myRecord
+                       # ...
+                       browsableType: tx_myext_mytable
+                       propertyPath: properties.myRecordUid
+                       # ...
+
+Similar to the :yaml:`ContentElement` form element custom logic must be added in the matching frontend partial to actually display something for the selected record.
+
+
+Impact
+======
+
+Form definitions can be set up to allow editors the selection of arbitrary database records and then render them using custom logic.
+
+.. index:: Backend, ext:form
\ No newline at end of file
diff --git a/typo3/sysext/form/Resources/Public/JavaScript/Backend/FormEditor/InspectorComponent.js b/typo3/sysext/form/Resources/Public/JavaScript/Backend/FormEditor/InspectorComponent.js
index 3be29a3bcc7b..f90be5d2fd5c 100644
--- a/typo3/sysext/form/Resources/Public/JavaScript/Backend/FormEditor/InspectorComponent.js
+++ b/typo3/sysext/form/Resources/Public/JavaScript/Backend/FormEditor/InspectorComponent.js
@@ -2368,11 +2368,6 @@ define(['jquery',
         'Invalid configuration "propertyPath"',
         1477300590
       );
-      assert(
-        'tt_content' === editorConfiguration['browsableType'] || 'pages' === editorConfiguration['browsableType'],
-        'Invalid configuration "browsableType"',
-        1477319859
-      );
 
       getHelper()
         .getTemplatePropertyDomElement('label', editorHtml)
-- 
GitLab