https://bugzilla.wikimedia.org/show_bug.cgi?id=42641
Web browser: ---
Bug #: 42641
Summary: mysterious error if module registration throws an
exception
Product: MediaWiki extensions
Version: master
Platform: All
OS/Version: All
Status: NEW
Severity: minor
Priority: Unprioritized
Component: EventLogging
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Classification: Unclassified
Mobile Platform: ---
If you leave out or misname the schema key when you register a schema module,
you get an error on every page:
'jQuery is not defined' in
http://localhost/wiki/load.php?debug=true&lang=en&modules=skins.vector&only=scripts&skin=vector&
without a stack trace, Neither jQuery nor mediaWiki is available to the page.
What happens is the first resource request
http://localhost/wiki/load.php?debug=true&lang=en&modules=startup&only=scripts&skin=vector&*
contains only JavaScript comments that report the PHP exception ( /* exception
'MWException' with message 'SchemaModule options must set a "schema" key.' ...)
, and so the second RL request results in random errors.
To reproduce, add the module from EventLogging/examples/module-declaration.php
but leave out or garble schema:
$wgResourceModules[ 'schema.Person' ] = array(
'class' => 'SchemaModule',
'schemaOOPS' => 'Person',
);
Then load any page. ?debug=1 doesn't help identify the error.
I'm not sure how or whether to fix this, and it's probably a ResourceLoader
issue rather than this particular extension. It's good that RL failures are
reported in comments rather than messing up the page.
Anyway, I updated
https://www.mediawiki.org/wiki/ResourceLoader/Developing_with_ResourceLoader#Debugging
to say that PHP errors appear in comments.
--
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l