Page MenuHomePhabricator

MWException raised when the ContentModel of a page is changed to NewsletterContent
Closed, ResolvedPublic

Description

If a page (in any content model) consisting of valid JSON representing a Newsletter, but the title does not match the name of an existing newsletter, and you try to change the content model of that page to NewsletterContent (using Special:ChangeContentModel), an MWException saying "Cannot find newsletter with name NEWSLETTER_NAME" is thrown, which appears as an internal error.

Details

Related Gerrit Patches:

Related Objects

StatusSubtypeAssignedTask
DuplicateQgil
ResolvedQgil
ResolvedQgil
DeclinedNone
ResolvedAddshore
DuplicateNone
Resolvedori
ResolvedBawolff
ResolvedGlaisher
ResolvedTinaj1234
DeclinedNone
ResolvedGlaisher
Resolved01tonythomas
ResolvedGlaisher
Resolved01tonythomas
OpenNone
OpenDaimona
OpenDaimona
Resolved01tonythomas
ResolvedQgil
ResolvedFilip
ResolvedD3r1ck01
ResolvedNone
Resolved01tonythomas
Resolved01tonythomas
Resolved01tonythomas
Resolved01tonythomas
ResolvedPppery

Event Timeline

Pppery created this task.Dec 31 2016, 8:51 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 31 2016, 8:51 PM

Well, we cannot fix this (other than maybe showing a better error message, or even stopping the transacation from happening). Can you check if the page got moved succesfully, like your FooChangedModelPage is accessible, even though it shows this exception ? If it is, then we might be able to implement some hook to stop this thing from happening.

I think you are confusing my two tasks here. This one is about content models, and the content model change does not happen after this error, and the page is still viewable normally in its previous content model.

I think you are confusing my two tasks here. This one is about content models, and the content model change does not happen after this error, and the page is still viewable normally in its previous content model.

Right, in that case no changes were committed and its a \m/ situation. I think we can close this one safely then ? If no changes are commited to the db,and a proper exception is thrown - that is the best we can do, I guess ? Thoughts ?

Change 329815 had a related patch set uploaded (by Pppery):
Introduce stricter validation involving Newsletters' content models

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

Pppery added a comment.Jan 1 2017, 3:48 AM

... and you said it could not be fixed ...

Change 329815 merged by jenkins-bot:
Introduce stricter validation involving Newsletters' content models

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

01tonythomas closed this task as Resolved.Jan 3 2017, 9:03 PM
01tonythomas assigned this task to Pppery.
Qgil awarded a token.Jan 7 2017, 10:36 AM