[BUGFIX] sql_free_result does not work with all allowed types

sql_free_result throws a fatal error when called with a
boolean. According to the method description boolean is an
allowed type. Check if $res is an object.

Change-Id: I6f7cdbb42c07869a320510e9b0b779f2b7cf6b70
Resolves: #50378
Releases: 6.2, 6.1
Reviewed-on: https://review.typo3.org/22594
Reviewed-by: Dan Untenzu
Tested-by: Dan Untenzu
Reviewed-by: Christian Kuhn
Reviewed-by: Stefan Neufeind
Reviewed-by: Markus Klein
Tested-by: Markus Klein
[BUGFIX] Don't run processIncludes more than once

processIncludes() is run "mandatory" from the stack ->start()
->runThroughTemplates() and doing all the work that needs to be done.

Resolves: #54903
Releases: 6.2
Change-Id: Id2be1a25aa23a05849297315c74358a9ef4ff9bb
Reviewed-on: https://review.typo3.org/26748
Reviewed-by: Alexander Opitz
Tested-by: Alexander Opitz
Reviewed-by: Oliver Klee
Reviewed-by: Markus Klein
Tested-by: Markus Klein
[CLEANUP] Code style of authentication classes

Clean up the source code of the authentication classes.
This patch does not change any functionality.
It serves as a basis for further improvements.

Resolves: #57788
Releases: 6.2
Change-Id: I555456c28da6697398a15ad9718a162f98aef61a
Reviewed-on: https://review.typo3.org/29322
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
[CLEANUP] Remove deprecated filemount functions in BE_USER

With the introduction of the file abstraction layer,
the filemount functionality was deprecated in 6.0
but wasn't removed.

However, the usage of addFileMount() in  rtehtmlarea and
EXT:recordlist is now removed, since the added filemounts
are never read anywhere, so this is only dead code.

The functionality needs to be re-implemented.

Releases: 6.2
Resolves: #56772
Change-Id: I20ec66f46f15a785f5014cb625dabef711fae0a1
Reviewed-on: https://review.typo3.org/28265
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Oliver Klee
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
[BUGFIX] Follow up foreign_match_fields not fully supported

On detaching related objects the foreign_match_fields needs
to be cleared.

Resolves: #47694
Relates: #45337
Releases: 6.2, 6.1
Change-Id: I6d74201afc437a2b0e2a73022bc71ed0cd1dd2d4
Reviewed-on: https://review.typo3.org/26694
Reviewed-by: Wouter Wolters
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
[CLEANUP] Error handling classes

* fixes CGL issues in annotations,
* fixes wrong annotations,
* introduces use statements

Resolves: #57661
Releases: 6.2
Change-Id: I41363888c523aedd13a795572d8c66430c0f34e3
Reviewed-on: https://review.typo3.org/29178
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Oliver Klee
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
[CLEANUP] Fix length of comments to meet CGL

Resolves: #57819
Releases: 6.2
Change-Id: I24a860dda49504e8745fe195f74c519a73a22991
Reviewed-on: https://review.typo3.org/29376
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Markus Klein
Tested-by: Markus Klein
[TASK] Improve comments and phpdoc blocks in PageRepository

* fix comment line lengths to improve readability and meet the CGL
* add some additional line breaks in comments to improve readability
* add missing @throws annotations in phpdoc blocks
* add missing @var annotations in phpdoc blocks

Resolves: #57859
Releases: 6.2
Change-Id: I311c6c858c8810b4a8906918378629aef5e1ebc8
Reviewed-on: https://review.typo3.org/29425
Reviewed-by: Oliver Klee
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
[BUGFIX] Improve database scheme updater

This patch improves the update process as it removes the hard stop after
an SQL error occurred. All queries should get executed and errors should
be reported at the end. Sometimes it gets necessary that the updater is
called more that once - a notice to the user is added.

Besides the index length is reduced by 1 to ensure the index is set
with limitation in the database and all fields can be updated in the
second step.

Resolves: #57421
Releases: 6.2
Change-Id: I2f830a8a62b8dff3fbe949d40de8ddc30f3dfb9a
Reviewed-on: https://review.typo3.org/28945
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
Reviewed-by: Dmitry Dulepov
Tested-by: Dmitry Dulepov
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
[CLEANUP] Improve comments in TypoScriptFrontendController

Resolves: #57814
Releases: 6.2
Change-Id: I0f92a0695f5897eb0311f68bfd21ebb40d9303d8
Reviewed-on: https://review.typo3.org/29355
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Oliver Klee
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
[BUGFIX] Properly detect HHVM with fastcgi

Extend the PHP_SAPI check with "srv" to match the interface between
the webserver and PHP also for Facebook's HHVM and set the paths
correctly for HHVM hostings.

Resolves: #57785
Releases: 6.2
Change-Id: Ie9e302f9ce606158f5e70af1930eda778a8a5a34
Reviewed-on: https://review.typo3.org/29335
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
[CLEANUP] ImportExportController code style

Introduce getters for global objects

Resolves: #57855
Releases: 6.2
Change-Id: I08d37c8934a4b89ef92d31d96073c293a89f04e1
Reviewed-on: https://review.typo3.org/29411
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Oliver Klee
Reviewed-by: Stefan Neufeind
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
[CLEANUP] Remove unnecessary @todo annotations

Removes "Define visibility" @todo annotations in
phpdoc blocks of public variables and methods which
are used in index_ts.php and have therefore be public.

Resolves: #57865
Releases: 6.2
Change-Id: Ide7190fcabb802bf5f4706c916f2e3ac0ee53be7
Reviewed-on: https://review.typo3.org/29434
Reviewed-by: Oliver Klee
Reviewed-by: Stefan Neufeind
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
[BUGFIX] Admin users should ignore user mounts

Admin user records still process earlier defined mounts which leads
to a cluttered page tree or filelist tree, respectively.

Resolves: #57587
Releases: 6.2
Change-Id: I9cae20da90f4f796db8a8831a09e5f4d029ae249
Reviewed-on: https://review.typo3.org/29110
Reviewed-by: Dmitry Dulepov
Tested-by: Dmitry Dulepov
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
[BUGFIX] Make Extbase Cli\RequestBuilder a Singleton

Like the Web\RequestBuilder the Cli\RequestBuilder is a service
object for the RequestHandler. It gets injected and has no
internal state, thus it should be a Singleton.

Resolves: #57591
Releases: 6.2
Change-Id: I959fcfdbc4182cd86cd38d438a0ff7f0de1845f1
Reviewed-on: https://review.typo3.org/29112
Reviewed-by: Wouter Wolters
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
[BUGFIX] Tests: Namespaced usage of vfsStream

vfsStream was namespaced a while ago. While ext:phpunit still has
a Migration to map non namespaced classes to the namespaced ones,
they should not be used any longer.

Change-Id: I44dcda6707cf6410125f01552c995a27113b3cc2
Resolves: #57872
Related: #51436
Releases: 6.2
Reviewed-on: https://review.typo3.org/29440
Reviewed-by: Oliver Klee
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
[TASK] Mitigate erroring builds

Builds error regularily because our scripts
need to output something at least every 10 minutes.

This might not happen as the complete functional test
suite takes longer than that.

To avoid these issues, only execute unit tests and lint
in parallel and each functional test suite.

By doing so, each functional test suite can take
up to 10 minutes which is for now a limit we do not
reach.

Releases: 6.2
Change-Id: I74cac706748cc03388f814f09e799a8705a26bca
Reviewed-on: https://review.typo3.org/29133
Reviewed-by: Markus Klein
Reviewed-by: Stefan Neufeind
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
[BUGFIX] Fix impexp for importing exports from version 4.x

This patch introduces FAL support in impexp for the import of
exports done in version 4.x by using a legacy mode. Related images
from uploads/ (tt_content:images and pages:media) are moved to
the folder /_imported/ below users default storage.
Linked files and RTE images are moved to the original folder
structure below the folder /_imported/ below users default storage.

Also the images additional information, like titleTexts and links are
migrated to the new created file reference record.

These scenarios are covered with functional tests:
* pages media
* pages_language_overlay media
* tt_content images
* links to files
* links to files in RTE
* images in RTE
* other records using fields of type "group" internal_type "file"
  or "file_reference" in TCA and FlexForm fields.

Resolves: #52593
Releases: 6.2
Change-Id: I170ec20827af255f85ddc0fd51ffe30df7ef6b4e
Reviewed-on: https://review.typo3.org/22939
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
[BUGFIX] impexp has to use module dispatcher

Resolves: #57873
Releases: 6.2
Change-Id: I6f622c32429143bd55ffe9286a26a920d791ea5b
Reviewed-on: https://review.typo3.org/29443
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
[BUGFIX] Add available jQuery version to PageRenderer

The core still ships jQuery 1.9.1 within the contrib folder,
but the list of available versions in PageRenderer does not
contain that version.

Lets just add it.

Resolves: #57466
Releases: 6.2
Change-Id: I10f8e1d24b0c8a8864187c2fe3641cce4303fb5c
Reviewed-on: https://review.typo3.org/29449
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters