Allow title for new comments to come from the URL
Closed, ResolvedPublic

Assigned To
None
Priority
Normal
Author
bzimport
Subscribers
Catrope, wikibugs-l
Projects
Reference
bz13100
Description

Author: md5

Description:
Modifies prepolution of edit form to recognize a "preloadtitle" parameter for new sections

The attached patch enables the use of a "preloadtitle" URL parameter to pre-populate the comment title when section=new is passed. This allows for simple creation of comments on a centralized page where the comment title is defaulted to the name of the page hosting the link. This would be useful on Wiktionary for the new feedback functionality we have been experimenting with over the last week or so, among other things. The patch was created today from SVN trunk.


Version: unspecified
Severity: enhancement

attachment EditPage.php-preloadtitle.diff ignored as obsolete

bzimport added a project: MediaWiki-Page-editing.Via ConduitNov 21 2014, 10:04 PM
bzimport added a subscriber: wikibugs-l.
bzimport set Reference to bz13100.
bzimport created this task.Via LegacyFeb 22 2008, 3:59 AM
bzimport added a comment.Via ConduitFeb 22 2008, 5:07 PM

md5 wrote:

After some discussion on English Wiktionary's Beer Parlour, it may make more sense for this to apply to more than just new sections. If that were the case, it would probably make more sense for it to be called "preloadsummary" instead of "preloadtitle". The patch would be more complicated for that case since the interaction with the preloaded section comments would need to be worked out in the case of editing an existing section.

bzimport added a comment.Via ConduitFeb 22 2008, 6:56 PM

conrad.irwin wrote:

I assumed that preload itself doesn't work for editing already existing sections, wouldn't that overwrite the contents that should be there? I think that the "preloadtitle" is an adequate name for the feature - as that is what it would be used for. This would be very useful for creating RfV/RfD (add to page) links as well.

bzimport added a comment.Via ConduitFeb 22 2008, 7:12 PM

ran.arigur wrote:

I assumed that preload itself doesn't work for editing already existing
sections [...]

Correct. preloadsummary, however, might be useful more generally; it could
perhaps be appended to the default summary. (I can't say that I care much one
way or the other. This simply came up because my temporary JavaScript solution
doesn't check to make sure it's on a section=new page, so would support
preloadtitle on any page. If people don't like that, we can stick with
preloadtitle.)

bzimport added a comment.Via ConduitFeb 26 2008, 8:42 PM

md5 wrote:

Has anyone had a chance to look at this patch? I'd be happy to make any changes necessary to get it into SVN.

Catrope added a comment.Via ConduitFeb 26 2008, 10:41 PM

Patch applied as posted in r31329

bzimport added a comment.Via ConduitFeb 26 2008, 10:47 PM

ran.arigur wrote:

Thanks! :-)

bzimport added a comment.Via ConduitMar 1 2008, 6:04 AM

md5 wrote:

Replacement for previous patch...

The previous patch just went live and did not work correctly. The value of $this->summary was being wiped out after being set (in the initialiseForm() method).

This revised patch reverses the earlier patch and does the check for "preloadtitle" inside of initialiseForm() instead of inside importFormData(). It adds a global import of $wgRequest in initialiseForm() because the request parameters are not available in that method otherwise.

I have tested this patch in a local MediaWiki installation, unlike the previous patch (*hanging head in shame*).

Attached: EditPage.php-preloadtitle.diff

Catrope added a comment.Via ConduitMar 1 2008, 9:47 AM

I fixed this issue in r31419. The line in initialiseForm() blanking $this->summary was completely useless as $this->summary is blank by default anyway.

bzimport added a comment.Via ConduitMar 11 2008, 9:34 PM

alexsm333 wrote:

Would it be possible to make "preloadtitle" work on section=0?

That's another case when summary is blank, so it would be nice to have the option to pre-populate it from URL.

Add Comment