Page MenuHomePhabricator

Providing an invalid template file in RL module definition causes silent failure
Closed, ResolvedPublic


Author: jgonera

If you misspell the file name in Resources.php, the whole module will not be loaded without any error message.

Version: unspecified
Severity: normal



Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:29 AM
bzimport set Reference to bz56076.

bingle-admin wrote:

Prioritization and scheduling of this bug is tracked on Mingle card

Should be easy to do - we can just check the file path. Leave with me.

Actually it does check for non-existance of a file so I'm unclear what kind of failure do you want?

Should it load the entire module without that template? Isn't that worse?

If you look at the JavaScript for the module with an invalid template it looks like this:
exception 'MWException' with message 'MFResourceLoaderModule::getTemplateScript: template file not found: "/Users/jrobson/Sites/w/extensions/MobileFrontend/templates/overlays/notificationz.html"' in /Users/jrobson/Sites/w/extensions/MobileFrontend/includes/modules/MFResourceLoaderModule.php:85
Stack trace:
#0 /Users/jrobson/Sites/w/extensions/MobileFrontend/includes/modules/MFResourceLoaderModule.php(145): MFResourceLoaderModule->getTemplateScript()
#1 /Users/jrobson/Sites/w/includes/resourceloader/ResourceLoader.php(755): MFResourceLoaderModule->getScript(Object(ResourceLoaderContext))
#2 /Users/jrobson/Sites/w/includes/resourceloader/ResourceLoader.php(517): ResourceLoader->makeModuleResponse(Object(ResourceLoaderContext), Array, Array)
#3 /Users/jrobson/Sites/w/load.php(43): ResourceLoader->respond(Object(ResourceLoaderContext))
#4 {main}
/* cache key: my_wiki:resourceloader:filter:minify-js:7:81f0ab7a7bc627ae9c0157fe6df772e6 */
is an alternative approach but I'm not sure if it is any better.

Marking fixed as reporter merged the patch.