[BUGFIX] Fix inconsitency of file reference property getters 98/18698/2
authorHelmut Hummel <h.hummel@bitmotion.de>
Tue, 12 Feb 2013 17:32:23 +0000 (18:32 +0100)
committerHelmut Hummel <helmut.hummel@typo3.org>
Tue, 5 Mar 2013 13:26:17 +0000 (14:26 +0100)
commit6fb5b099657bd2086075b799f60215a8b7e2c728
treeb9cb9f51c5ce1ab8d07657e7e2ea540ccfed2ba8
parent6e5ec413c47ed278111ad766baeecb7406cae97b
[BUGFIX] Fix inconsitency of file reference property getters

The FileReference object has the following getters
for getting properties:

getProperties()
getReferenceProperties()
getProperty($key)
getReferenceProperty($key)

The result from these getters is inconsistent:

getReferenceProperty($key)
Returns the value of a property which is only
in the reference properties

getReferenceProperties()
Returns merged properties form the original
file and the reference properties without
respecting overriding of reference properties
if they are not set to NULL

getProperty($key)
Returns the merged value from original file
and reference, respecting the NULL override
handling. But if a property is only available
in the original file an Exception is thrown.

getProperties()
Returns merged properties form the original
file and the reference properties
respecting overriding of reference properties
if they are not set to NULL
Properties only available in the original file
will be available in the resulting array.

Streamline the behaviour so that all getters
starting with "getReference" will only return
the properties of the reference record and all
other will return the merged properties but
respecting the NULL override handling.

Resolves: #45416
Releases: 6.0, 6.1

Change-Id: I35a84da83be765991b357c5cee89ce018a1f1e24
Reviewed-on: https://review.typo3.org/18223
Reviewed-by: Steffen Ritter
Tested-by: Wouter Wolters
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
Reviewed-on: https://review.typo3.org/18698
typo3/sysext/core/Classes/Resource/FileReference.php
typo3/sysext/core/Tests/Unit/Resource/FileReferenceTest.php [new file with mode: 0644]