Closed dmolineus closed 3 years ago
This will be fixed in 4.24.11.
Btw. what about using regular TL_HOOKS
and changing it to
foreach (array_merge($GLOBALS['HASTE_HOOKS']['undoData'] ?? [], $GLOBALS['TL_HOOKS']['hasteUndoData'] ?? []) as $callback) {
This way you could register the Hook with the @Hook
annotation.
@fritzmg that's a good idea, added in 34a6820.
Ah, I think this needs to be adjusted as well:
Right 🤦 1f6c3835 should do now.
Contao supports the usage of services for hooks for a long time. Haste still create the hook instance for itself, so it's not possbile to use services with proper DI.
https://github.com/codefog/contao-haste/blob/c040b0eb397771fb575273a8a88112e6a6b52d4f/library/Haste/Util/Undo.php#L97-L103
Line 99 should use
\Contao\Controller::importStatic()
.