Bug #89523
openEpic #90129: [Extbase] Issues regarding hidden or deleted records
Hidden records are not found when explicitly enabled
0%
Description
When ignoreEnableFields is set to true and an action with the hidden record in arguments is called, then an exception is thrown:
Object of type Vendor\Example\Domain\Model\Record with identity "xxx" not found.
To reproduce:
Create a simple controller and an action
public function editAction(Record $record)
{
//Do staff
}
Create a simple RecordRepository with following initializeObject function
public function initializeObject()
{
$querySettings = GeneralUtility::makeInstance(Typo3QuerySettings::class);
$querySettings->setIgnoreEnableFields(true);
$querySettings->setRespectStoragePage(false);
$this->setDefaultQuerySettings($querySettings);
}
Redirect to the editAction with a hidden Record
Updated by Alexander Schnitzler almost 5 years ago
- Status changed from New to Accepted
- Complexity set to medium
- Is Regression set to No
I can confirm the described behavior.
The issue is caused by the PersistentObjectConverter which directly asks the PersistenceManager for an entity which then does not respect any settings of the repository.
Question is, if this is a bug or desired behavior.
Personally I would say that Extbase is not made to restrict the user but to give him the freedom he lacks when sticking to typoscript or other core functions, therefore I'd say that the user should have access to hidden and deleted resources and has to act accordingly himself.
Means: The property mapper should simply map the property and the user must decide whether to display the entity in the frontend.
Updated by Christian Kuhn over 3 years ago
- Related to Bug #84955: Extbase persistence layer ignores query settings added