[TYPO3-dev] (solved, maybe) looking for a hook to use before rendering a backend page
Ivano Luberti
luberti at archicoop.it
Wed Feb 26 10:37:20 CET 2014
Even if I have not seen much interest on this issue I post my progresses
anyway, maybe someone one day can find them useful
I have found a solution but I think is not the most proper one.
I'm working on TYPO3 6.1.7 and debugging step by step I have found in
\TYPO3\CMS\Backend\Controller\EditDocumentControler->makeEditForm
the following hook
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/alt_doc.php']['makeEditForm_accessCheck']
It works because for, some reason, the method fetches the record 2
times: the first time before setting the value of hasAccess and the
second time immediately after it has passed the test on hasAccess.
The values used to reneder the form are the ones in the second instance,
so modifying the DB data in the meanwhile works.
I'm not fully satisfied with this solution because I fear one day
someone recognize this can be optimized and instead of redoing a query in
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Form\\DataPreprocessor->fetchRecord($table,
$theUid, $cmd == 'new' ? 'new' : '');
decides to pass to fetchrecord the $calcPRec variable and mostly the
name of the hook seems to say that it is not intended for record
preprocessing but to possibly modify right access to a record.
Finally I note that
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Form\\DataPreprocessor
seems not to have aby hook
--------------------------------
Hello all, I'm currently modifyng itypoexpiringfegroups to tightly
integrate it with the TYPO3 group management so that the usergroup field
reflects the content of itypoexpiringfegroups field. I'm planning to
make the changes available if the actual maintainer agrees with my changes.
I have already been able to hook the process during frontend user logon
and even to hack current extension javascript to modify values of
usergroup field in the backend form when itypoexpiringfegroups is edited.
The last thing I want to achieve is that when the form to edit a user is
called, before showing the values, I can hook the process to possibly
modify the value of usergroup field taking into account expiration or
starting validity of groups contained in itypoexpiringfegroups field.
I have already found
$TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tceforms.php']['getSingleFieldClass']
but even if I can change value in the DB before showing them, I cannot
update the $row['usergroup'] value. So backend user would see
potentially expired values and save them back erroneously.
Does someone knows if exists a suitable hook for my needs?
--
==================================================
dott. Ivano Mario Luberti
Archimede Informatica societa' cooperativa a r. l.
Sede Operativa
Via Gereschi 36 - 56126- Pisa
tel.: +39-050- 580959
tel/fax: +39-050-9711344
web: www.archicoop.it
==================================================
More information about the TYPO3-dev
mailing list