[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
[TASK] Rename tt_content.tx_irretutorial_hotels in tests

This change affects EXT:irre_tutorial and functional tests only:
* rename tx_irretutorial_hotels to tx_irretutorial_1nff_hotels
* use constants for table and field names in functional tests

Resolves: #56132
Releases: 6.2
Change-Id: Iee2240c489c5523fbea208145ba667f349fde592
Reviewed-on: https://review.typo3.org/27744
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
[BUGFIX] DatabaseConnection::listQuery wrong usage of strpos()

In DatabaseConnection::listQuery strpos() is used with wrong
parameter order.

Resolves: #56135
Releases: 6.2, 6.1, 6.0
Change-Id: Iaa18d46442a2aac21a836216cb61ae376bbb2090
Reviewed-on: https://review.typo3.org/27749
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
[BUGFIX] Make Typo3DbBackend use DatabaseConnection

While Typo3DbBackend claims to be Extbase's connection to
the TYPO3 API, in reality it writes a lot of SQL state-
ments itself. This replaces self-written statements with
the according DatabaseConnection API call.

Releases: 6.2
Resolves: #55571
Change-Id: Ia4f6ef0aadda16b6c5e89c7b36c8f91b185aac25
Reviewed-on: https://review.typo3.org/27254
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Tymoteusz Motylewski
Tested-by: Tymoteusz Motylewski
Reviewed-by: Mathias Brodala
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
[BUGFIX] moveContentRecordToDifferentPageAndChangeSorting fails

In a workspace, an existing content record is moved to an
existing page. Another existing record is moved after the
previously moved record on the target page. The Functional
Tests show, that the content records are faulty after the
processing and the first content record disappeared.

A similar behaviour has been discovered for pages which finally
lead to the regression causing this bug in issue #33104. Back
then a hook has been introduced for moving page records and
post-processing the database values. However, this hook has
been called for all move operations for any table and was wrong
in terms of the expected specific problem to be solved.

The hook gets reverted, since it's sufficient to resolve move
placeholders if a record shall be created after an existing one.

Resolves: #55573
Releases: 6.2
Change-Id: Ie5cbc95daf4d46f4204cf18e80e17ff4fa37f496
Reviewed-on: https://review.typo3.org/27733
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
[TASK] Fix a few variable names

Fix a few typo in the variable names.

Change-Id: I334e31a1e8e37ce7a79a3b905758843d51463c26
Releases: 6.2
Resolves: #56165
Reviewed-on: https://review.typo3.org/27762
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
[BUGFIX] Update file type on mimetype change

If the mime type of a file has changed, the type property of a file
will be updated, too.

Resolves: #54305
Releases: 6.2
Change-Id: I013e2adbbb3d3cd3973ab50c8e88806b9477fe90
Reviewed-on: https://review.typo3.org/26288
Reviewed-by: Markus Klein
Reviewed-by: Marcin Sągol
Reviewed-by: Steffen Ritter
Tested-by: Markus Klein
Tested-by: Steffen Ritter
[TASK] Integrate IRRE CSV Functional Tests

Integrate comma separated value functional tests for Inline
Relational Record Editing for both live and workspace context.

Resolves: #56143
Releases: 6.2
Change-Id: I8750cabd2e4df41e229ada888a43a104339cc55c
Reviewed-on: https://review.typo3.org/27752
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
[BUGFIX] Parent localization pointer missing in IRRE tests

The parent localization pointer (in this very case
l18n_parent, instead of l10n_parent) is missing in
the DataSet scenarios and assertions.

Resolves: #56161
Releases: 6.2
Change-Id: Ieac6dd15d84f15488e0ee4690186efe2fb8dead6
Reviewed-on: https://review.typo3.org/27768
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
[TASK] Add functional tests for discarding created elements

The workspaces API has the command "clearWSID" that reverts
elements that have been modified/created/deleted in a workspace.
The regular behavior is to keep the elements but mark it as
deleted and unset the value in "t3ver_wsid".

Resolves: #56179
Releases: 6.2
Change-Id: I55bc72add6f41449dd99f5b6b2816cd1cda3e092
Reviewed-on: https://review.typo3.org/27769
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
[TASK] Use environment variable for functional test bootstrap

Make it possible to determine the original root path
of the installation by setting an environment variable
just like in unit test bootstrap.

Releases: 6.2
Resolves: #56182
Change-Id: I42af5d4db20a23eb5d1ce90fc87b6df818a11e88
Reviewed-on: https://review.typo3.org/27771
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
[BUGFIX] Remove class loader in functional test tear down

The functional test teardown does not remove the
class loader but removes the instance directories.
Because of this the TYPO3 class loader is still
triggered (by PHPUnit classes) and tries to write
things to a cache directory that does not exist any more.

Resolves: #56086
Releases: 6.2
Change-Id: Ib6acb588fb8b84c64d04882228822f6398838b6b
Reviewed-on: https://review.typo3.org/27775
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
[BUGFIX] RTE cannot run in IE 11+ with ExtJS 3.4.1

Solution: Configure a hook in frontend to add a meta tag just after
the head tag whenever rtehtmlarea is in use on the page and the user
agent is IE 11+. The meta tag instructs IE to emulate IE 10.

Resolves: #56192
Releases: 6.2
Change-Id: Icc81f14c107360a47a34403032e5fe7890f1d784
Reviewed-on: https://review.typo3.org/27776
Reviewed-by: Markus Klein
Reviewed-by: Wouter Wolters
Reviewed-by: Stanislas Rolland
Tested-by: Stanislas Rolland
[TASK] Cleanup \TYPO3\CMS\Lang\LanguageService

* Cache hsc values of calls to sL()
* Code cleanup
* Use !empty() instead of count() for objects known to be an array

Change-Id: Ie015f9755b98c41df185865325ea15ce42179e23
Resolves: #56109
Releases: 6.2
Reviewed-on: https://review.typo3.org/27745
Reviewed-by: Steffen Ritter
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Oliver Klee
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
[BUGFIX] Fix PHP warnings in functional tests

Some PHP warnings occur in functional tests due
to missing initialization of arrays or unused
function parameters.

Resolves: #56203
Related: #56187
Releases: 6.0
Change-Id: I1cd75de253382759315a8f72cff6e497b31bcc07
Reviewed-on: https://review.typo3.org/27785
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
[BUGFIX] Use absolute path to check for extensions

The functional test utility assumes that the current
working directory is the document root, which must
not necessarily be true.

Use the absolute path to check for existence of
extension directories instead.

Resolves: #56204
Releases: 6.2
Change-Id: I9e5fa06f0e069c04586de7c23edc80e070ef4aa9
Reviewed-on: https://review.typo3.org/27786
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
[TASK] Add additional configuration for functional tests

Our functional test suit does not fail currently when
tested code emits a PHP warning. This is due to the
fact that the factory configuration uses the
production exception handler which silently discards
warnings.

This change adds additional configuration that
is merged with the factory configuration.

In this configuration the TYPO3 exception handling
is disabled and the core and classes cache is
disabled.

Additionally a new property is added to the base
class to easily add some configuration values that
might be needed for the test case.

Resolves: #56187
Related: #56086
Releases: 6.2
Change-Id: I5c7c2c0d495bae06a56d2285b8d521eaa4ab37d2
Reviewed-on: https://review.typo3.org/27773
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
[TASK] New SignalSlot after preInit in EditDocumentController

Adds a new SignalSlot possibility after the preInit method call.

Resolves: #56195
Releases: 6.2
Change-Id: Ia68734999a0e5fbe6c945d9e28d8571cd6192e75
Reviewed-on: https://review.typo3.org/27777
Reviewed-by: Tomas Norre Mikkelsen
Tested-by: Tomas Norre Mikkelsen
Reviewed-by: Erik Frister
Tested-by: Erik Frister
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring