DEV: Add useful error message for hbs register_asset (#19185)

This hasn't been necessary for many years, and is no longer supported following 84bec1cb. Only extremely old plugins might be trying to do this. All the affected open-source plugins I can find have already been updated.
This commit is contained in:
David Taylor 2022-11-24 19:03:06 +00:00 committed by GitHub
parent c4fdc48164
commit abe2813789
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -586,6 +586,13 @@ class Plugin::Instance
end
def register_asset(file, opts = nil)
if file.end_with?(".hbs", ".handlebars")
raise <<~ERROR
[#{name}] Handlebars templates can no longer be included via `register_asset`.
Any hbs files under `assets/javascripts` will be automatically compiled and included."
ERROR
end
if opts && opts == :vendored_core_pretty_text
full_path = DiscoursePluginRegistry.core_asset_for_name(file)
else