Last modified: 2009-11-26 03:38:45 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 2795 - __NOEDITSECTION__ in a template affects entire page
__NOEDITSECTION__ in a template affects entire page
Status: RESOLVED WORKSFORME
Product: MediaWiki
Classification: Unclassified
Templates (Other open bugs)
unspecified
All All
: Normal normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
http://academia.wikicities.com/wiki/L...
:
Depends on: 8515
Blocks:
  Show dependency treegraph
 
Reported: 2005-07-11 07:22 UTC by John Schmidt
Modified: 2009-11-26 03:38 UTC (History)
0 users

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


Attachments
adds __NOEDITTHISSECTION__ (2.53 KB, patch)
2006-10-04 08:08 UTC, Fyren
Details
reworked patch (2.43 KB, patch)
2007-01-06 22:54 UTC, Carl Fürstenberg
Details
updated patch (3.34 KB, patch)
2007-01-06 23:37 UTC, Carl Fürstenberg
Details
same patch (3.31 KB, patch)
2007-01-06 23:43 UTC, Carl Fürstenberg
Details
new patch (3.58 KB, patch)
2007-01-06 23:59 UTC, Carl Fürstenberg
Details

Description John Schmidt 2005-07-11 07:22:24 UTC
I made some templates with many sections. If such a template is included in a
page, the page displays edit links for each section. Clicking on the edit links
for sections in the template opens the edit window for the template. In my case,
I do not want casual users editing the templates. This "feature" by which
templates can be edited from pages using templates can be blocked by including
__NOEDITSECTION__ in the template, but this also blocks editing of sections that
do not come from the template. Is there a way to restrict the action of
__NOEDITSECTION__ to only the sections in the template containing
__NOEDITSECTION__ ?

Alternatively, edit links that open templates for editing should be made to look
different or give a warning about the fact that a template is being edited.
Comment 1 Fyren 2006-10-04 08:08:10 UTC
Created attachment 2433 [details]
adds __NOEDITTHISSECTION__

This small patch adds a new directive, __NOEDITTHISSECTION__.  Any section with
this directive in it won't have an edit link in the heading. I've only tested
it on my personal wiki, but I haven't found any problems.  

Not sure if this is the best way to implement the feature, but it's an easy
way.  If there's a better way to implement it, I'd appreciate the advice.
Comment 2 Carl Fürstenberg 2007-01-06 22:31:05 UTC
the patch is broken atm.
Comment 3 Carl Fürstenberg 2007-01-06 22:54:11 UTC
Created attachment 3020 [details]
reworked patch

fixed the patch to work against current svn, also fixed some minor
inconsistency and reviewded it
Comment 4 Carl Fürstenberg 2007-01-06 23:37:35 UTC
Created attachment 3021 [details]
updated patch

added the logic that a sub section of a disabled section, shouldn't either have
an edit link
Comment 5 Carl Fürstenberg 2007-01-06 23:43:57 UTC
Created attachment 3022 [details]
same patch

forgot to remove a debug-statement
Comment 6 Carl Fürstenberg 2007-01-06 23:59:30 UTC
Created attachment 3024 [details]
new patch

added keyword __FORCEEDITTHISSECTION__ to enable edit section on a subsection
that is under a __NOEDITTHISSECTION__
Comment 7 Carl Fürstenberg 2007-01-07 00:11:43 UTC
This test case did I use:

==Foo==
__NOEDITTHISSECTION__
==Bar==
d
==Baz==
__NOEDITTHISSECTION__
===a===
===b===
====c====
__FORCEEDITTHISSECTION__
===d===
==Quux==
__NOEDITTHISSECTION__
==Quuux==
===e===
====f====
__NOEDITTHISSECTION__

==Quuuux==
Comment 8 Rob Church 2007-01-07 01:12:43 UTC
No, fix the problem, don't add in another hack to work around it.
Comment 9 Aryeh Gregor (not reading bugmail, please e-mail directly) 2007-01-07 01:14:20 UTC
Hmm, and here I was getting close to committing.  Oh, well.
Comment 10 stux 2007-01-14 22:57:40 UTC
8515 proposes the same solution to this problem, although these are not exactly
duplicates.  Marked as dependent
Comment 11 P.Copp 2009-11-26 03:38:45 UTC
With the new preprocessor, you can use now <h2>Heading</h2> to generate a section without edit links.

Marking as WORKSFORME.

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


Navigation
Links