Last modified: 2014-09-24 01:22:35 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 T4831, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 2831 - Links in autogenerated summary in page histories may point to wrong section or to nowhere
Links in autogenerated summary in page histories may point to wrong section o...
Status: REOPENED
Product: MediaWiki
Classification: Unclassified
Page editing (Other open bugs)
unspecified
All All
: Low normal with 16 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
http://en.wikipedia.org/wiki/Wikipedi...
:
: 2876 3355 4472 4707 6401 6517 10470 15668 18700 (view as bug list)
Depends on:
Blocks: 5019 section-editing
  Show dependency treegraph
 
Reported: 2005-07-13 00:27 UTC by Chris Sherlock
Modified: 2014-09-24 01:22 UTC (History)
25 users (show)

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


Attachments
Proposed fix (805 bytes, patch)
2006-08-26 22:21 UTC, Wil Mahan
Details

Description Chris Sherlock 2005-07-13 00:27:03 UTC
Add a new section with a wikilink in it. Say ==[[User:Jayjg|Jayjg]]==. Add a
__TOC__ tag, then click on the Jayjg section in the TOC. The URL that is
automatically generated in the edit history becomes
http://en.wikipedia.org/wiki/Randompage#User:Jayjg.7CJayjg instead of
http://en.wikipedia.org/wiki/Randompage#Jayjg. Editors cannot jump to the page
when they click on this link. This same problem happens when you add a new
section to the talk page with the wikilink in it. 

I've also noticed a problem with having duplicated heading titles. The second
heading title in the TOC, when clicked, jumps to the first section name.
Comment 1 lɛʁi לערי ריינהארט 2005-07-13 09:34:03 UTC
changed to WORKSFORME
follow versions beginning with
http://en.wikipedia.org/w/index.php?title=Wikipedia:Administrators%27_noticeboard&oldid=18707450#Jayjg

Regards Reinhardt [[user:gangleri]]
Comment 2 lɛʁi לערי ריינהארט 2005-07-13 09:42:14 UTC
P.S. to comment 1 (WORKSFORME with Windows XP and Firefox)

regarding last note in comment 0
> I've also noticed a problem with having duplicated heading titles. The second
heading title in the TOC, when clicked, jumps to the first section name.
this is bug 111 - "Bug 111: Return to page after edit of section (where section
name occurs multiple times)"
Comment 3 lɛʁi לערי ריינהארט 2005-07-15 21:13:04 UTC
Hallo!

I think the original bug report relates to return after edit sections.

after edit (maybe just edit, preview without changes) you will return to
http://en.wikipedia.org/wiki/Wikipedia:Administrators%27_noticeboard#.5B.5BUser:Jayjg.7CJayjg.5D.5D_-_.5B.5BUser:TShilo12.7CTshilo12.5D.5D

The anchor in the TOC is just #Jayjg_-_Tshilo12 - see
[[en:Wikipedia:Administrators%27_noticeboard#Jayjg_-_Tshilo12]] .

Changed subject to "return after edit sections using headings with wikilinks
returns to other anchors then the ones used in TOC".

This bug is quite old and has been seen in earlier versions too. This might be a
duplicate.

Best regards Reinhardt [[user:gangleri]]
Comment 4 Brion Vibber 2005-07-16 01:30:17 UTC
*** Bug 2876 has been marked as a duplicate of this bug. ***
Comment 5 lɛʁi לערי ריינהארט 2005-10-07 17:01:49 UTC
*** Bug 3355 has been marked as a duplicate of this bug. ***
Comment 6 lɛʁi לערי ריינהארט 2005-10-13 16:11:22 UTC
for impact on pages history see
bug 2346: Special characters break section links in page history

Comment 7 Zigger 2006-01-03 23:56:18 UTC
*** Bug 4472 has been marked as a duplicate of this bug. ***
Comment 8 Rob Church 2006-01-21 22:59:55 UTC
*** Bug 4707 has been marked as a duplicate of this bug. ***
Comment 9 Rob Church 2006-01-24 02:47:49 UTC
This one depends upon someone developing an effective function to turn wikitext
back into plaintext, which would, in a sense, be a mini-parser. Assigning to
self, but this is going to be ongoing.
Comment 10 David Benbennick 2006-01-24 03:33:58 UTC
(In reply to comment #9)
> This one depends upon someone developing an effective function to turn wikitext
> back into plaintext, which would, in a sense, be a mini-parser. Assigning to
> self, but this is going to be ongoing.

That seems wrong to me.  MediaWiki ''already'' knows how to turn the wikicode
of a section title into an anchor; that's what is used in the actual ToC links,
and in the section anchor names.  All that's required is for the section-editing
code to use the same method.  Avoid duplicating code!
Comment 11 Rob Church 2006-01-24 03:35:43 UTC
(In reply to comment #10)

Shockingly, I was already scouting round and checking for things to avoid that.

Comment 12 lɛʁi לערי ריינהארט 2006-01-24 11:11:35 UTC
(In reply to comment #9)
> ... Assigning to
> self, but this is going to be ongoing.

Thanks Rob for taking this bug!

If you change TOC issues please see if you can fix also:
Bug 4039: BiDI: please preserve dir="ltr" and dir="rtl" in TOC

Bug 4050: BiDi: orientation and numbering inside a TOC should be left aligned if
placed in a LTR block and RTL if not
is very complex. Please keep it in mind when change TOC issues.

best regards reinhardt [[user:gangleri]]
Comment 13 lɛʁi לערי ריינהארט 2006-02-14 23:55:24 UTC
Dear Rob!

Created
http://test.wikipedia.org/wiki/User:Gangleri/tests/bugzilla/section_links/wiki_syntax
with many unusual sections using all kind of wiki syntax.

Please take a look also at the "→" ("autocomment") links:
http://test.wikipedia.org/w/index.php?title=User:Gangleri/tests/bugzilla/section_links/wiki_syntax&action=history
Many of them are broken. Breaking "Return after section" does *not* correspond
one to one with breaking "autocomment"

best regards reinhardt [[user:gangleri]]
Comment 14 Rob Church 2006-06-22 16:00:36 UTC
*** Bug 6401 has been marked as a duplicate of this bug. ***
Comment 16 Christoph Burgmer 2006-06-24 17:44:26 UTC
You forgot
 .replace(/^:/g, "")
in case of a linked category.
Comment 17 David Benbennick 2006-06-24 17:54:28 UTC
(In reply to comment #16)
> You forgot
>  .replace(/^:/g, "")
> in case of a linked category.

Well, not quite.  You don't want to break

== :[[Foo]] ==

which should become #:Foo

Also,

== [[Foo ==

currently doesn't work, since the Javascript turns it into #Foo when it
should remain #:.5B.5BFoo.  This workaround is better than nothing,
but I guess it isn't feasible to make it perfect.  You'd have to
build in a complete MediaWiki parser to fix all possible cases.  (Actually,
you could just copy whatever part of MediaWiki makes the section IDs.)
Comment 18 Rob Church 2006-07-02 18:59:49 UTC
*** Bug 6517 has been marked as a duplicate of this bug. ***
Comment 19 Wil Mahan 2006-08-26 22:21:52 UTC
Created attachment 2272 [details]
Proposed fix

Here is a simple patch that seems to fix the problem.
This uses the same code as my proposed fix to bug 2346,
only in a different place.

I didn't write a mini-parser as described in
comment #9, and things like italics in headings
still break.
Comment 20 Roan Kattouw 2007-07-05 08:44:42 UTC
*** Bug 10470 has been marked as a duplicate of this bug. ***
Comment 21 Roan Kattouw 2007-09-06 11:44:27 UTC
This has *finally* been fixed by TimLaqua in r25573. All hail Tim ;)
Comment 22 Aryeh Gregor (not reading bugmail, please e-mail directly) 2007-09-06 17:29:53 UTC
This has not been fixed fully, only some of the simplest cases have been.  Try, for instance:

=={{CURRENTTIME}}==

This cannot be fixed until either we make section anchors based on raw wikitext and not the parsed version, or we run the full parser every time we want to make a section anchor.  (The latter is almost certainly impractical.)

Not all the simple cases have even been fixed.  Try this:

=='''Foo'''==
Comment 23 Tim Laqua 2007-09-06 17:39:00 UTC
I'll work on refining the pseudo-parsing for simple/common cases.
Comment 24 Roan Kattouw 2007-09-06 19:41:19 UTC
There's more that doesn't work. For instance:

== Hello ==
Anchor: Hello
Redirect: Hello
Edit summary: ->Hello

== [http://www.mediawiki.org] ==
Anchor: [1]
Redirect: [http://www.mediawiki.org]
Edit summary: ->[http://www.mediawiki.org]

== Hello ==
Anchor: Hello_2
Redirect: Hello
Edit summary: ->Hello

The third one is tricky, as we can't go around doing /* Hello 2 */, which would show ->Hello 2 in the edit summary. The second one should be fixed more easily, perhaps by changing the generated anchor to [http://www.mediawiki.org] as well.
Comment 25 Tim Laqua 2007-09-06 19:45:53 UTC
Fixed the simple wikitext quote parsing in r25598.

Looking in to the anchor generation for headings (R.E. Case 2)

With regard to case 3 - multiple sections with the same name - Unless we ram the entire article through the parser, there's no way to know.  The only option I can think of would be some predictive logic where we apply some simple regex work to the base article text - but we cant rewrite the entire parser and we really shouldn't run EVERY anchor link through the parser - those solutions are simply wasteful.
Comment 26 Roan Kattouw 2007-09-06 20:02:33 UTC
(In reply to comment #25)
> With regard to case 3 - multiple sections with the same name - Unless we ram
> the entire article through the parser, there's no way to know.  The only option
> I can think of would be some predictive logic where we apply some simple regex
> work to the base article text - but we cant rewrite the entire parser and we
> really shouldn't run EVERY anchor link through the parser - those solutions are
> simply wasteful.
> 

Can't we just regex for section titles (something like '^=+ ?(.*?) ? =+$' I believe, not very good at regexes though), pseudo-parse them all and see if there are dupes?
Comment 27 Tim Laqua 2007-11-25 19:05:48 UTC
(In reply to comment #26)
> (In reply to comment #25)
> > With regard to case 3 - multiple sections with the same name - Unless we ram
> > the entire article through the parser, there's no way to know.  The only option
> > I can think of would be some predictive logic where we apply some simple regex
> > work to the base article text - but we cant rewrite the entire parser and we
> > really shouldn't run EVERY anchor link through the parser - those solutions are
> > simply wasteful.
> > 
> Can't we just regex for section titles (something like '^=+ ?(.*?) ? =+$' I
> believe, not very good at regexes though), pseudo-parse them all and see if
> there are dupes?

Where are we at on this one?  I while back Tim Starling refactored a bit - can we come up w/ a new list of things that aren't working w/ regard to new section anchor links?
Comment 28 Tim Starling 2008-09-21 10:17:59 UTC
*** Bug 15668 has been marked as a duplicate of this bug. ***
Comment 29 Derk-Jan Hartman 2010-11-04 21:53:50 UTC
This seems mostly fixed, only issues like with {{CURRENTTIME}} remain.
Comment 30 p858snake 2011-04-30 00:09:40 UTC
*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*
Comment 31 Sumana Harihareswara 2011-11-09 23:38:55 UTC
+need-review since Will Mahan's contribution in comment 19 hadn't been reviewed.  Thank you for the patch, Will.
Comment 32 Roan Kattouw 2011-11-20 19:08:26 UTC
(In reply to comment #31)
> +need-review since Will Mahan's contribution in comment 19 hadn't been
> reviewed.  Thank you for the patch, Will.
It looks like that patch is obsolete now per comment 21?
Comment 33 Sumana Harihareswara 2011-11-21 10:27:34 UTC
Comment on attachment 2272 [details]
Proposed fix

Patch no longer applies to trunk, so marking obsolete (checked by Rusty per http://lists.wikimedia.org/pipermail/wikitech-l/2011-November/056340.html ).
Comment 34 Sumana Harihareswara 2011-11-21 10:29:31 UTC
Chris, if you are still encountering this problem in more recent versions of MediaWiki, please let us know.

Will, if you'd like to revise your patch to work with the current codebase, please do and resubmit.  Thanks!
Comment 35 Bartosz Dziewoński 2013-05-22 18:31:42 UTC
*** Bug 18700 has been marked as a duplicate of this bug. ***

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


Navigation
Links