[ticket/11749] Move event after all template data has been defined

PHPBB3-11749