Last modified: 2014-02-26 12:54:51 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 T44641, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 42641 - mysterious error if module registration throws an exception
mysterious error if module registration throws an exception
Status: RESOLVED INVALID
Product: Analytics
Classification: Unclassified
EventLogging (Other open bugs)
unspecified
All All
: Unprioritized minor
: ---
Assigned To: Ori Livneh
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-03 05:05 UTC by spage
Modified: 2014-02-26 12:54 UTC (History)
8 users (show)

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


Attachments

Description spage 2012-12-03 05:05:29 UTC
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.
Comment 1 spage 2012-12-03 05:10:08 UTC
Related: bug 42166 "load.php should return HTTP 500 if one or more exceptions were thrown during the generation of the module response(s)".
Comment 2 Ori Livneh 2012-12-19 09:53:56 UTC
It's a ResourceLoader issue; there is nothing specific to EventLogging about it. The same thing happens if, for example, a standard module declaration refers to a file that doesn't exist.

Back-end errors are logged by the back end.
Comment 3 Andre Klapper 2014-02-26 12:54:51 UTC
[moving from MediaWiki extensions to Analytics product - see bug 61946]

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


Navigation
Links