Last modified: 2014-02-12 23:52:50 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T58076, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 56076 - Providing an invalid template file in RL module definition causes silent failure
Providing an invalid template file in RL module definition causes silent failure
Status: RESOLVED FIXED
Product: MobileFrontend
Classification: Unclassified
stable (Other open bugs)
unspecified
All All
: Unprioritized normal
: ---
Assigned To: Jon
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-24 00:37 UTC by Juliusz Gonera
Modified: 2014-02-12 23:52 UTC (History)
9 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Juliusz Gonera 2013-10-24 00:37:45 UTC
If you misspell the file name in Resources.php, the whole module will not be loaded without any error message.
Comment 1 Bingle 2013-10-24 00:38:17 UTC
Prioritization and scheduling of this bug is tracked on Mingle card https://wikimedia.mingle.thoughtworks.com/projects/mobile/cards/1329
Comment 2 Jon 2013-10-24 01:59:33 UTC
Should be easy to do - we can just check the file path. Leave with me.
Comment 3 Jon 2013-10-24 19:29:35 UTC
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}
*/
mw.loader.state({"mobile.beta.common":"missing"});
/* cache key: my_wiki:resourceloader:filter:minify-js:7:81f0ab7a7bc627ae9c0157fe6df772e6 */
Comment 4 Jon 2013-10-24 19:34:24 UTC
https://gerrit.wikimedia.org/r/91658
 is an alternative approach but I'm not sure if it is any better.
Comment 5 Arthur Richards 2013-11-04 23:36:08 UTC
Marking fixed as reporter merged the patch.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links