Ok, the culprit was this old plugin I didn’t even remember I had installed:-
Too bad I didn’t find the safe mode earlier when googling for howto repair a Discourse site and went through so much experimentation. But I learned a lot about Discourse from this.