Can’t help with the trigger issue, but here’s a fix for the typo:
https://github.com/discourse/discourse/pull/4869