Fix Robert's commit
When $form is not an instance of FOFForm the onAfterLoadForm should not be called due to its signature