Method typeClass() in site-setting.js.es6 incorrectly handles multiword setting types

The problem line:

Surely, it must be:

return componentType.replace(/_/g, '-');

For now, typeClass() incorrectly handles multiword setting types, for example: my_setting_type => my-setting_type because JavaScript String.replace() method replaces only the first occurence by default.

4 Likes

Thanks. Just pushed a fix :turtle:

https://github.com/discourse/discourse/commit/95c8ec50a872fab0e37ef7da7f2678542003c504

(next time you can submit a PR if you want)

3 Likes