Hi!
I did a thorough review now of your intention. I fully agree that your request for the hook being called is very valid indeed, but your solution is breaking "everything".
The good news, we might be able to tweak this to get it right.
First, some observations about PageRepository¶
$this->where_hid_del
and $this->where_groupAccess
are always used by simply concatenating them in exactly this order.
- In the
getPage()
method there's an option to omit the $this->where_groupAccess
part.
From this we can conclude that $this->where_groupAccess
may only contain conditions belonging to group access checks, as the name suggests.
Using enableFields() like you suggested, is plain wrong¶
because this regenerates all the hidden, disabled etc. conditions again and assigns them to $this->where_groupAccess
, which breaks observation number two.
But, the init()
function + the result of getMultipleGroupsWhereClause()
do actually generate the very same query as enableFields()
would do, just the query is properly separated into the variables.
But, there's one exception: The behaviour is different if $this->versioningPreview
is TRUE and $this->versioningPreview_where_hid_del
is not set accordingly.
In getWorkspaceVersionOfRecord()
there's also a comment why $this->versioningPreview_where_hid_del
is necessary:
// Have to hardcode it for "pages" table since TCA is not loaded at this moment!
Solutions¶
So if you can ensure that TCA is availalbe at this point, you may refactor the code, such that enableFields() can be used within the TypoScriptFrontendController::fetch_the_id() method.
Another option might be to add the hook call also to TypoScriptFrontendController::fetch_the_id() after the call to setSysPageWhereClause()