Fix deprecated warning in form extension