Page MenuHomePhabricator

Do not add a title to an upload page if {{int:filedesc}} is blank
Closed, ResolvedPublic

Description

Special:Upload prepends "== {{int:filedesc}} ==" to file upload pages. If the filedesc message has been deliberately changed from its default value ("Summary" in English) to a blank value, then do not prepend any title at all.

Currently, if filedesc is blank, then the file upload page is prepended with "== ==".

Note, as per matthiasmullie's comment on T187302, it used to be possible to default to no title until his change of 6 Mar 2018.

Event Timeline

Also, the header should probably take its markup from MediaWiki:Newsectionheaderdefaultlevel instead of hard-coding it.

Change #1121125 had a related patch set uploaded (by Mr. Starfleet Command; author: Mr. Starfleet Command):

[mediawiki/core@master] Check if filedesc is empty and use newsectionheaderdefaultlevel

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

Mr._Starfleet_Command changed the task status from Open to In Progress.Apr 17 2026, 4:32 AM
Mr._Starfleet_Command claimed this task.

Test wiki created on Patch demo by Mr. Starfleet Command using patch(es) linked to this task:
https://997c0a9f49.catalyst.wmcloud.org/w/

Test wiki created on Patch demo by Mr. Starfleet Command using patch(es) linked to this task:
https://997c0a9f49.catalyst.wmcloud.org/w/

I was planning to test my patch with the above, but I can't upload files there because of T422996: Uploading files not working due to MediaWiki not being able to open a lock file. I'll try again once that bug is fixed. That said, my patch passed the automatic verification, and I'm pretty confident it does what it's supposed to. So, hopefully, this task will be resolved before too long. :)

Test wiki on Patch demo by Mr. Starfleet Command using patch(es) linked to this task was deleted:

https://997c0a9f49.catalyst.wmcloud.org/w/

Test wiki created on Patch demo by Mr. Starfleet Command using patch(es) linked to this task:
https://e5b942930e.catalyst.wmcloud.org/w/

I've tested it, and it works: an image uploaded while the system message is non-empty (e.g. has its default content) gets the section header, while an image uploaded after the system message was blanked doesn't include a header at all. Yay! Now my patch just needs to get merged.

Test wiki on Patch demo by Mr. Starfleet Command using patch(es) linked to this task was deleted:

https://e5b942930e.catalyst.wmcloud.org/w/

Change #1121125 merged by jenkins-bot:

[mediawiki/core@master] Check if filedesc is empty and use newsectionheaderdefaultlevel

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

Change #1328367 had a related patch set uploaded (by Mr. Starfleet Command; author: Mr. Starfleet Command):

[mediawiki/core@master] Follow section headers by single newline instead of double newline

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

Change #1328367 merged by jenkins-bot:

[mediawiki/core@master] Follow section headers by single newline instead of double newline

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