FIX: Core templates should never overwrite theme/plugins (#12988)
This happened in Ember CLI due to a different script load order.
This commit is contained in:
parent
bc3c3d56e0
commit
225c0d2d96
|
@ -2,7 +2,11 @@ import { getResolverOption } from "discourse-common/resolver";
|
|||
|
||||
export const __DISCOURSE_RAW_TEMPLATES = {};
|
||||
|
||||
export function addRawTemplate(name, template) {
|
||||
export function addRawTemplate(name, template, opts = {}) {
|
||||
// Core templates should never overwrite themes / plugins
|
||||
if (opts.core && __DISCOURSE_RAW_TEMPLATES[name]) {
|
||||
return;
|
||||
}
|
||||
__DISCOURSE_RAW_TEMPLATES[name] = template;
|
||||
}
|
||||
|
||||
|
|
|
@ -143,7 +143,7 @@ TemplateCompiler.prototype.processString = function (string, relativePath) {
|
|||
");\n\n" +
|
||||
'addRawTemplate("' +
|
||||
filename +
|
||||
'", template);\n' +
|
||||
'", template, { core: true });\n' +
|
||||
"export default template;"
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue