Last modified: 2013-09-04 15:05:40 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 T45008, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 43008 - [Regression] MWException when saving section=new on .css and .js pages
[Regression] MWException when saving section=new on .css and .js pages
Status: VERIFIED FIXED
Product: MediaWiki
Classification: Unclassified
ContentHandler (Other open bugs)
1.21.x
All All
: High normal (vote)
: 1.21.0 release
Assigned To: Wikidata bugs
: code-update-regression
: 43784 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-12 14:14 UTC by Brad Jorsch
Modified: 2013-09-04 15:05 UTC (History)
8 users (show)

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


Attachments

Description Brad Jorsch 2012-12-12 14:14:07 UTC
To reproduce:

1. Open a css page for editing with section=new, e.g. http://en.wikipedia.org/wiki/Special:MyPage/common.css?action=edit&section=new
2. Enter text.
3. Click "Save page".

Ideally the initial action=edit&section=new should present an error message. At the least, the attempted save should present an error message instead of throwing an uncaught exception.


Exception:

2012-12-12 14:11:05 mw55 enwiki: [3e244cf2] /w/index.php?title=User:Anomie/common.css&action=submit   Exception from line 1466 of /usr/local/apache/common-local/php-1.21wmf5/includes/WikiPage.php: sections not supported for content model css
#0 [internal function]: WikiPage->replaceSectionContent('new', Object(CssContent), 'test')
#1 /usr/local/apache/common-local/php-1.21wmf5/includes/Article.php(1944): call_user_func_array(Array, Array)
#2 /usr/local/apache/common-local/php-1.21wmf5/includes/EditPage.php(1486): Article->__call('replaceSectionC...', Array)
#3 /usr/local/apache/common-local/php-1.21wmf5/includes/EditPage.php(1486): Article->replaceSectionContent('new', Object(CssContent), 'test')
#4 /usr/local/apache/common-local/php-1.21wmf5/includes/EditPage.php(1133): EditPage->internalAttemptSave(false, false)
#5 /usr/local/apache/common-local/php-1.21wmf5/includes/EditPage.php(396): EditPage->attemptSave()
#6 /usr/local/apache/common-local/php-1.21wmf5/includes/actions/EditAction.php(51): EditPage->edit()
#7 /usr/local/apache/common-local/php-1.21wmf5/includes/actions/EditAction.php(71): EditAction->show()
#8 /usr/local/apache/common-local/php-1.21wmf5/includes/Wiki.php(429): SubmitAction->show()
#9 /usr/local/apache/common-local/php-1.21wmf5/includes/Wiki.php(305): MediaWiki->performAction(Object(Article), Object(Title))
#10 /usr/local/apache/common-local/php-1.21wmf5/includes/Wiki.php(555): MediaWiki->performRequest()
#11 /usr/local/apache/common-local/php-1.21wmf5/includes/Wiki.php(448): MediaWiki->main()
#12 /usr/local/apache/common-local/php-1.21wmf5/index.php(59): MediaWiki->run()
#13 /usr/local/apache/common-local/live-1.5/index.php(3): require('/usr/local/apac...')
#14 {main}
Comment 1 Helder 2012-12-12 14:23:18 UTC
Confirmed also on JS pages.
Comment 2 Daniel Kinzler 2012-12-12 15:06:12 UTC
Adding sections to JS/CSS pages doesn't make sense and will not be supported.
But there should be no fatal error, this should be handled more nicely.
Comment 3 Brad Jorsch 2012-12-12 20:29:45 UTC
(In reply to comment #2)
> But there should be no fatal error, this should be handled more nicely.

Exactly.
Comment 4 Daniel Kinzler 2012-12-14 09:18:16 UTC
Change I3d2901b7: (bug 43008) show error page if sections not supporte.
Comment 5 Alexandre Emsenhuber [IAlex] 2013-01-21 14:51:43 UTC
Change merged.
Comment 6 Helder 2013-02-24 20:45:41 UTC
*** Bug 43784 has been marked as a duplicate of this bug. ***
Comment 7 Rainer Rillke @commons.wikimedia 2013-03-13 21:43:57 UTC
for the reasons mentioned in Bug 43784, it makes sense for me.
Comment 8 Daniel Kinzler 2013-03-14 13:14:03 UTC
This should no longer be an *internal* error, but a "normal" user level error. Which it currently is, as far as I can see.

I maintain that adding sections to JavaScript makes no sense and is misleading. Section support needs more than just adding sections, it also needs a way to split a text by section, etc. This would horribly break JS. 

The use case described by bug 43784 is a nasty hack, if you want a nice interface for appending to page text, file a feature request for that.

I'll not close this now, so to not start an edit war. I suggest however to again close this as fixed, especially since the original problem, the fatal error, is gone. What is left is a request to restore the ability to somehow append to JavaScript. That should be a separate bug.
Comment 9 Brad Jorsch 2013-03-14 14:06:32 UTC
(In reply to comment #8)
> 
> I'll not close this now, so to not start an edit war. I suggest however to
> again close this as fixed, especially since the original problem, the fatal
> error, is gone. What is left is a request to restore the ability to somehow
> append to JavaScript. That should be a separate bug.

I'll close it again. For the reasons above, if you want an interface to append arbitrary text to any page, even pages that don't support sections, open a new bug.
Comment 10 abraham.taherivand 2013-09-04 15:05:40 UTC
Verified in Wikidata demo time

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


Navigation
Links