[BUGFIX] Fix grouping of file references in FlexForms of workspaces 91/37891/4
authorStephan Großberndt <stephan@grossberndt.de>
Mon, 16 Mar 2015 18:44:19 +0000 (19:44 +0100)
committerMarkus Klein <klein.t3@reelworx.at>
Tue, 7 Apr 2015 22:23:12 +0000 (00:23 +0200)
With this patch file references in FlexForms of content elements in a
alternative workspace are grouped with the changed content element
again and are published with it.

Resolves: #65126
Releases: master, 6.2
Change-Id: I2774c175ec29a2e6556128e49d8b1fd9b5595b56
Reviewed-on: http://review.typo3.org/37891
Reviewed-by: Dominique Kreemers <dominique.kreemers@arrabiata.de>
Tested-by: Dominique Kreemers <dominique.kreemers@arrabiata.de>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/version/Classes/Dependency/ElementEntity.php
typo3/sysext/version/Classes/Dependency/ElementEntityProcessor.php

index 17f408e..4056f3e 100644 (file)
@@ -330,11 +330,11 @@ class ElementEntity {
         * @return array
         */
        public function getRecord() {
-               if (empty($this->record['uid']) || (int)$this->record['uid'] !== $this->id) {
+               if (empty($this->record['uid']) || (int)$this->record['uid'] !== $this->getId()) {
                        $this->record = array();
-                       $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,pid,t3ver_wsid,t3ver_state,t3ver_oid', $this->getTable(), 'uid=' . $this->getId());
-                       if (is_array($rows)) {
-                               $this->record = $rows[0];
+                       $row = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('uid,pid,t3ver_wsid,t3ver_state,t3ver_oid', $this->getTable(), 'uid=' . $this->getId());
+                       if (is_array($row)) {
+                               $this->record = $row;
                        }
                }
                return $this->record;
index dbebf55..b9caff5 100644 (file)
@@ -88,7 +88,7 @@ class ElementEntityProcessor {
         */
        public function createNewDependentElementChildReferenceCallback(array $callerArguments, array $targetArgument, ElementEntity $caller, $eventName) {
                $fieldConfiguration = BackendUtility::getTcaFieldConfiguration($caller->getTable(), $callerArguments['field']);
-               if (!$fieldConfiguration || !GeneralUtility::inList('field,list', $this->getDataHandler()->getInlineFieldType($fieldConfiguration))) {
+               if (!$fieldConfiguration || ($fieldConfiguration['type'] !== 'flex' && !GeneralUtility::inList('field,list', $this->getDataHandler()->getInlineFieldType($fieldConfiguration)))) {
                        return ElementEntity::RESPONSE_Skip;
                }
                return NULL;
@@ -105,7 +105,7 @@ class ElementEntityProcessor {
         */
        public function createNewDependentElementParentReferenceCallback(array $callerArguments, array $targetArgument, ElementEntity $caller, $eventName) {
                $fieldConfiguration = BackendUtility::getTcaFieldConfiguration($callerArguments['table'], $callerArguments['field']);
-               if (!$fieldConfiguration || !GeneralUtility::inList('field,list', $this->getDataHandler()->getInlineFieldType($fieldConfiguration))) {
+               if (!$fieldConfiguration || ($fieldConfiguration['type'] !== 'flex' && !GeneralUtility::inList('field,list', $this->getDataHandler()->getInlineFieldType($fieldConfiguration)))) {
                        return ElementEntity::RESPONSE_Skip;
                }
                return NULL;