[TASK] Extend DataHandler IRRE functional tests

* create and copy
* create and localize
* modify and discard
* create and copy and discard
* create and localize and discard

Resolves: #56072
Releases: 6.2
Change-Id: Iead056883f7bbb2072a0bd082b05094d7d46101d
Reviewed-on: https://review.typo3.org/27693
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
[BUGFIX] Indexer does not update the FileObjects

If the Indexer updates metadata during runtimer (after a file object)
has been created, the file object itself is not updated.

This leads to possible errors with image rendering, if files are to be
shown which have not been indexed before.

Releases: 6.2
Resolves: #53772
Change-Id: I70be5ebefe1e00e903694a576847fa8fba167461
Reviewed-on: https://review.typo3.org/27690
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
[BUGFIX] No duplicate insertion in addToAllTCAtypes

This patch improves the regular expression in
ExtensionManagementUtility::executePositionedStringInsertion().

It is made sure that the field name ends with a comma or a line
ending to prevent duplicate insertions of the string when field
names start with the same substring.

Resolves: #55932
Releases: 6.2
Change-Id: I375c40760a38b7f939086bb851911bd7f52509ca
Reviewed-on: https://review.typo3.org/27583
Reviewed-by: Michiel Roos
Tested-by: Michiel Roos
Reviewed-by: Markus Klein
Tested-by: Markus Klein
[BUGFIX] Check identity map for existing objects

The DataMapper should check if an object is already in the identityMap
before calling fetchRelated, since otherwise the object will be retrieved
from the database again.

Resolves: #53514
Releases: 6.1,6.2
Change-Id: I24e262322f1f0ba3c346fa01c50fa9063866aef7
Reviewed-on: https://review.typo3.org/25252
Reviewed-by: Nico de Haen
Reviewed-by: Fabien Udriot
Tested-by: Wouter Wolters
Reviewed-by: Steffen Müller
Tested-by: Steffen Müller
[BUGFIX] Show labels of additional doktypes in new page drag area

Get the labels for the doktypes from TCA

Resolves: #52955
Releases: 6.2, 6.1
Change-Id: I6d70c11f1711bf191a4ce14a91796819224649da
Reviewed-on: https://review.typo3.org/24934
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
[BUGFIX] Various static calls to non-static functions

Resolves: #56067
Releases: 6.2, 6.1, 6.0
Change-Id: I6d1e19026afde81bec46cec3dff9060fa6042c43
Reviewed-on: https://review.typo3.org/27679
Reviewed-by: Oliver Klee
Reviewed-by: Wouter Wolters
Reviewed-by: Markus Klein
Tested-by: Markus Klein
[BUGFIX] FAL links in RTE not transformed when link has rel attribute

Problem: When the RTE inserts the link, the href looks like
http://somedomain/?file:1234. If a rel attribute is present, the link
is not transformed into a typolink on the way to the database.
However, the href attribute is not transformed, as it should, into a
normal file url. It should because the a-tag will be rendered as is in
the frontend.

Solution: When a link is not be transformed into a typolink,
transform the href into a normal file url.

Resolves: #54944
Release: 6.2
Change-Id: I92c45363ffd62de0f4e89941944f55320d4fc708
Reviewed-on: https://review.typo3.org/27142
Reviewed-by: Stefan Froemken
Tested-by: Stefan Froemken
Reviewed-by: Steffen Ritter
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
[BUGFIX] RTE: Required ExtJs css files are not loaded in frontend

Solution: Add ExtJs css files required by the RTE

Resolves: #56027
Releases: 6.2
Change-Id: I56c81a0119a34097aa8c4a3dd15655cb5a6ca635
Reviewed-on: https://review.typo3.org/27647
Reviewed-by: Wouter Wolters
Reviewed-by: Stanislas Rolland
Tested-by: Stanislas Rolland
[BUGFIX] Suppress EXIF warnings indexing images

FileContentParser used to issue a warning trying to index image
files with corrupted EXIF data. Suppress these warnings to fail
silently.

Resolves: #55286
Releases: 6.2, 6.1
Change-Id: I863601f5579ab74a0743ab684cf1d898b633edba
Reviewed-on: https://review.typo3.org/27160
Reviewed-by: Wouter Wolters
Reviewed-by: Dmitry Dulepov
Tested-by: Dmitry Dulepov
Reviewed-by: Markus Klein
Tested-by: Markus Klein
[CLEANUP] GeneralUtility::getFilesInDir()

Refactor getFilesInDir to use scandir().

Change-Id: Iafca3e7b7610ef0b11441ef118c85c8e6cc481b8
Resolves: #54095
Releases: 6.2
Reviewed-on: https://review.typo3.org/25768
Reviewed-by: Michiel Roos
Tested-by: Michiel Roos
Reviewed-by: Markus Klein
Tested-by: Markus Klein
[BUGFIX] Discard vs. Delete workspace changes in tests

Discarding workspace changes works with the version command
"clearWSID" which might come down to a "delete" action if the
versioned records have a delete or new placeholder (which is
the case for copied or localized elements).
However, the functional tests need to use the "clearWSID"
instead of the "delete" command.

Resolves: #56111
Releases: 6.2
Change-Id: Id10413048a68abdb5ef05bb6e20e6cb6460f9742
Reviewed-on: https://review.typo3.org/27712
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
[TASK] getFilesInDirCanOrderByMtime-test should use vfs

As the other tests in GeneralUtilityTest also
getFilesInDirCanOrderByMtime() should use vfs.
Otherwise we might run into random problems if some
mtimes are equal.

Change-Id: Ic5ad10bd5beedb26c00d48602ebd5455525e4826
Resolves: #56121
Releases: 6.2
Reviewed-on: https://review.typo3.org/27717
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
[TASK] getFilesInDirCanOrderByMtime-test should use vfs

Follow-up for PHP 5.3 compatiblity.

Resolves: #56121
Releases: 6.2
Change-Id: I948eb3063c2e6b014b8d69c2011789c7dbe58748
Reviewed-on: https://review.typo3.org/27719
Reviewed-by: Michiel Roos
Tested-by: Michiel Roos
Reviewed-by: Markus Klein
Tested-by: Markus Klein
[TASK] Add framework for frontend rendering functional tests

To ensure that actions in the backend have an accordant and
correct impact in the frontend, a frontend request needs to
be triggered from the functional test execution.
The response of that simulated frontend request shall be
delivered as JSON, exceptions need to be caught and
forwarded to the test suite as well. Besides that, it is
required to have a possibility to set up TypoScript
configuration, modify TCA and TYPO3_CONF_VARS for further
hook processing.

Resolves: #55882
Releases: 6.2
Change-Id: I54d475e8f1ce01fd7cb8c64b68c2318b1e9f7bbe
Reviewed-on: https://review.typo3.org/27413
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
[TASK] Enable DataHandler frontend rendering tests

After having performed changes to data structures using the
DataHandler, the correct impact for the frontend needs to be
asserted. This patch checks the correct behavior for DataHandler
action tests for regular, MM and IRRE disposal.

Resolves: #56104
Releases: 6.2
Change-Id: I99f11f6b039c31e08614caf8ee9bca9d47700b93
Reviewed-on: https://review.typo3.org/27711
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
[BUGFIX] Categories as exclude field

When a table is marked as being categorizable, the
categories field is added with an "exclude" flag
hard-coded to 0. Thus it is not possible to hide
this field for editors.

This patch changes the default value to 1 and makes
overridable.

Resolves: #53454
Documentation: #55718
Releases: 6.2
Change-Id: Iff2431b4294b8d3b9cf3dff291186e1a6a2ebafb
Reviewed-on: https://review.typo3.org/27373
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Francois Suter
Tested-by: Francois Suter
[TASK] Optimize GeneralUtility::trimExplode()

This often used method can be about 5% more performant by rewriting it.

Change-Id: Iee80a35ebd98c3521a75977bc7ab45d170858e24
Resolves: #55198
Releases: 6.2
Reviewed-on: https://review.typo3.org/27086
Reviewed-by: Markus Klein
Tested-by: Markus Klein
[FEATURE] Introduce MM_oppositeUsage property

On copying a sys_category record, a new MM reference is created,
however without setting the "fieldname". This value is basically
defined from the opposite entity with MM_match_fields, but
cannot be accessed.

This change introduces the MM_oppositeUsage property for MM
definitions in the TCA.

Example:
'config' => array(
  'allowed' => '*',
  'MM' => 'tx_myextension_first_second_mm',
  'MM_oppositeUsage' => array(
    'tt_content' => array('somefield'),
    'tx_myextension_domain_model' => array('some_property'),
  ),
),

Resolves: #56061
Documentation: #56123
Releases: 6.2
Change-Id: I26fd54688cf44d6a026ccdb3ca9276583b32acd3
Reviewed-on: https://review.typo3.org/27677
Reviewed-by: Wouter Wolters
Reviewed-by: Ernesto Baschny
Tested-by: Wouter Wolters
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
[BUGFIX] Use MM_oppositeUsage for category relations

The MM_oppositeUsage property allows to apply match fields
of the opposite relation to MM records. This feature shall
be enabled for sys_category records as well.

Resolves: #56122
Related: #56061
Releases: 6.2
Change-Id: I33c9f3c471d66c4154be5c2fb5180254401096f0
Reviewed-on: https://review.typo3.org/27731
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
[BUGFIX] Category localization cannot be rendered

Localized sys_category records cannot be rendered in frontend,
since only records with a positive pid value are overlaid -
however, sys_category is stored on the root-level.

Resolves: #56059
Releases: 6.2, 6.1
Change-Id: I211dad5086adf30723ef4f44757fe6a3121ac29e
Reviewed-on: https://review.typo3.org/27673
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader