Page MenuHomePhabricator

GettingStarted produces error when saving edits
Closed, ResolvedPublic

Description

Author: swalling

Description:
Getting "PHP fatal error in /usr/local/apache/common-local/php-1.24wmf1/extensions/GettingStarted/Hooks.php line 463:
Call to a member function getId() on a non-object" on save


Version: unspecified
Severity: critical

Details

Reference
bz64573

Event Timeline

bzimport raised the priority of this task from to Unbreak Now!.Nov 22 2014, 3:13 AM
bzimport set Reference to bz64573.

Yes. It's causing major problems here, with editing certain pages.

swalling wrote:

I get this on editing of User:Steven Walling/Sandbox and the Village Pump, but not Wikipedia:Sandbox when logged out or logged in. Bizarre.

The change to the software has been reverted.

It's not all pages (or at least not all edits), which is presumably why it worked locally and was not reported right away in production.

Reverted in production with https://gerrit.wikimedia.org/r/#/c/130228/ and https://gerrit.wikimedia.org/r/#/c/130229/ .

Apparently $revision can be null for "edits that change nothing" (i.e. null edits), which was recently documented at https://www.mediawiki.org/w/index.php?title=Manual:Hooks/PageContentSaveComplete&diff=923140&oldid=893753 . WikimediaEvents also has a check for this, which I didn't notice before (https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FWikimediaEvents.git/32f6e1390e8f66674d3d6925f752373bd3d3c3fb/WikimediaEventsHooks.php#L33)

Is it possible all of the edits that showed an error were null edits?

Anyway, the fix seems pretty clear: Do nothing if $revision is null, like WikimediaEvents.

Reopening. I'll close this when it's fixed in master.

(In reply to Matthew Flaschen from comment #5)

It's not all pages (or at least not all edits), which is presumably why it
worked locally and was not reported right away in production.
Reverted in production with https://gerrit.wikimedia.org/r/#/c/130228/ and
https://gerrit.wikimedia.org/r/#/c/130229/ .
Apparently $revision can be null for "edits that change nothing" (i.e. null
edits), which was recently documented at
https://www.mediawiki.org/w/index.php?title=Manual:Hooks/
PageContentSaveComplete&diff=923140&oldid=893753 . WikimediaEvents also has
a check for this, which I didn't notice before
(https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FWikimediaEvents.git/
32f6e1390e8f66674d3d6925f752373bd3d3c3fb/WikimediaEventsHooks.php#L33)
Is it possible all of the edits that showed an error were null edits?
Anyway, the fix seems pretty clear: Do nothing if $revision is null, like
WikimediaEvents.
Reopening. I'll close this when it's fixed in master.

no they were not.

Change 130247 had a related patch set uploaded by Mattflaschen:
Don't attempt to log if $revision is null

https://gerrit.wikimedia.org/r/130247

Change 130247 merged by jenkins-bot:
Don't attempt to log if $revision is null

https://gerrit.wikimedia.org/r/130247