SectionEdit-Talk

Summary: Talk page for SectionEdit.
Maintainer: Klonk
Users: +10 -1 (View / Edit)

This space is for User-contributed commentary and notes. Please include your name and a date along with your comment.

There is compatibility issue with the PreviewChanges recipe: If one clicks "Preview" it shows many "Deleted lines" for all other sections except the one, you are editing. Thank God, these are not deleted for real, if one clicks "Save".

bttr January 04, 2018, at 04:02 PM


Feb 13, 2017. wlkl

  • contrary to what is written in the Cookbook page Klonk says, he is neither the maintainer of sectionedit, nor does he have the necessary time. Furthermore, the author information in the source is quite confusing, Who volunteers?
  • PmWiki Analyzer complains about the version of SectionEdit, althouth is freshly downloaded
  • I guess this is caused by contradictory VersionInfos in the source
    • line 14: @version 2.3.3 (2015-05-21)
    • but line 247: $RecipeInfo['SectionEdit']['Version'] = '2013-02-06 - v2.2.3';

August 31, 2016 Lxndr

This is the only cookbook item I've added to my pmwiki. (version 2.2.89)

Update: 2.2.90 also fails with this.

When I add include_once("cookbook/sectionedit.php"); to my config file I get this error repeated (multiple times) on my wiki:

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/public/confessional/pmwiki.php on line 1711

Lxndr


  • Feb 4, 2013 Walter Keller:
    • Since I updated to Ubuntu 12.10 SectionEdit does not work anymore.
      • If you click on the section edit button an editor with empty text is shown.
      • If publish, the whole page (and not only the current section) is overwritten
    • Petko Yotov advised my, that this is related to PHP Version 5.4.6-1ubuntu1.1, and indeed
      • replacing all 3 calls of the htmlspecialchars() function in sectionedit.php by PHSC() function solved the problem
      • an Petko uploaded the fixed version to the cookbook, thus the problem should disappear with the newest version of sectionedit.php

  • I was installing the AutoSave cookbook when I ran into some weird problems. After some digging, I found out some of what was happening - Section Edit doesn't work with Drafts. Here's what I found:
    1. Have a page with multiple sections.
    2. Edit a section (e.g., section 2)
    3. Save a draft of that section (e.g., section 2)
    4. What seems to happen is that the draft of the section is saved *as if for the whole page*.
    5. Edit a different section or the whole page, and you've only got that section (section 2)
  • It seems we either need to disable drafts when editing sections (reasonable, but also means I can't use autosave, which I'd like to), or the Section Edit drafts need their own names for each section...which is trickier. Maybe an md5-sum of the content of the section could be used? But of course that doesn't work with nested sections... So perhaps Section Edit needs to save an entire page-draft and be ready to fail gracefully when/if it can't find the correct section in an existing draft. Just thinking out loud here :)

Peter Kay June 14, 2011, at 12:56 PM


  • Section edit 2.2.2 seems to be incompatible to PublishPDF (2.2.11, 2009-04-14). When I try to edit a header section it replaces the whole page with the edited part, thus destroying the page! Disabling wikipublisher/extension.php brings section edit back to normal. Frank July 01, 2009, at 10:23 AM

====

  • It seems sectionedit is incompatible with ROEPatterns/ROSPatterns. When a page is edited through the "edit section" link, ROEPatterns/ROSPatterns are not applied. Any way to fix this? pwuille May 30, 2008, at 08:31 AM

====

  • Wouldnt it be nicer if the edit link would be shown on the same line as the first line of the section instead of the line before? Marc Seibert August 26, 2005, at 11:52 AM
Well you can simply achieve this with the correct CSS code. Just change $HTMLStylesFmt['sectionedit'] after the include. Add float:right; into it or into your CSS file. Maybe I'll inlude that in a later version, we'll see. - Klonk
I included it in version 1.3.3 but removed it again in 1.3.4 as it brought more problems than it had benefits. Of course you can do it on your own and maybe you won't run in display problems (e.g. with %rframe%) - Klonk August 30, 2005, at 03:32 PM

====

  • Hi Klonk, nice work, thanxs. Is there a other way to change the section link from (Edit Section X) to Edit Section than to do it in the sourcecode? and, what would it take to just show the Section Edit link, if the user has the permission to edit? grz noskule August 31, 2005, at 11:49 AM
Change the display text in your XLPage (see above which strings to use). Regarding permission just write (:if ! auth edit:)(:nosections:)(:ifend:) somwhere in your text. Placing this in the GroupHeader or GroupFooter does not work at the moment - Klonk August 31, 2005, at 01:28 PM
hm, and if I would write it in Site.GroupHeader it sould work for all groups? This would be extra nice but I'm not shure if this is the pmwiki way . ..noskule September 01, 2005, at 07:22 AM
AFAIK no, it shouldn't work then for the whole wiki only for the Site group. Currently I try to find a better way to check the GroupHeader and GroupFooter. - Klonk September 01, 2005, at 09:04 AM
With release of version 2.0 the above markup works in GroupHeader and GroupFooter and also within conditional markup. - Klonk September 28, 2005, at 08:51 AM

==== September 06, 2005, at 10:35 AM : 'Moved Edit Links below Sections' \\

I edited my sectionedit.php source in order to move the section edit links down to the bottom of each section. Is there another way of doing this without editing the source document??

I edited lines 243 to this
$out2[] =" ".$p[$i];
$out2[] = Keep("<div class='sectionedit'>$editlink[$i]</div>")";
//$out2[] =" ".$p[$i];


==== Hi Klonk, I absolutely enjoy this script.
I would like to have the background either change color, or the text to change color when I hover over the Edit Section link and would like to do this using CSS. This would make it much easier to locate each section because I do have pages with many sections that are close together. Do you have any sugestions on how to incorporate the CSS?

This is easy just add div.sectionedit a:hover{ color:#f00;background-color:#0f0;}. The used colors are just examples. - Klonk.
it's doesn't work. the output is <div class='sectionedit'><a href='http://pmwiki-2.0.11/index.php?n=Main.HomePage?action=edit&amp;s=1&amp;auto=y&amp;from=Main.HomePage'>

(Edit Section ↓)</a></div> and the "a" class is not define

  • It does work. You have to edit the file sectionedit.php because that is where the css is located for the section edit link.
    • Of course, this didn't work for me as I hope because I wanted the whole background to change color and only the link background changes color with this code. I decided not to make an issue out of it. Navet October 20, 2005, at 02:04 PM

A related quick tip:

For 'stealthy' links, which are hidden unless you put the mouse near where you expect them to be try replacing:

/*** defines the layout of the section edit links */
SDV($HTMLStylesFmt['sectionedit'], "
div.sectionedit { text-align:right;font-size:smaller;clear:both;}
");

with

/*** defines the layout of the section edit links */
SDV($HTMLStylesFmt['sectionedit'], "
div.sectionedit { text-align:right;font-size:smaller;clear:both;}
div.sectionedit a { color: #ffffff}
div.sectionedit a:visited { color: #ffffff}
div.sectionedit:hover a { color: #999999}
div.sectionedit:hover a:visited { color: #999999}
div.sectionedit:hover a:hover { color: #0033cc}
");

==== Version 2.0 works great. Looks sharp!.
Feature Request: Would it be possible to change $SectionEditAutoDepth to an array so I can set the values of headings to edit. For example I would like to only edit headings 2 and 4 only. Not 1~4.
I don't know that much about preg_split , but believe it to be able to take array values. Maybe instead of a $SectionEditAutoDepth, creat an array:
$SectionEdit[Level] = 2;
$SectionEdit[Level] = 4;

Good work Klonk.- navet September 28, 2005, at 12:42 PM

I don't think it is a good idea to include it in the standard version, but I it should be possible. The only problem I see is when using MediaWiki style. I'll think about that - Klonk September 29, 2005, at 01:22 AM
OK, I looked at the code and decided not to do that. Giving such a feature would only make sense when it could be adjusted with different stuff e.g. make it possible to use ---- also for autosectioning. But then we run heavily into problems with MediaWiki style. What should be considered as borders for the sections? To include such a feature would be possible though but I want to avoid creeping featurism. Let's discuss on the mailinglist - Klonk September 29, 2005, at 01:56 AM
What is the latest on this? Is it now possible? I'd like to do pretty much the same thing (no edit heading for level 1 which is redundant to the way I have pages laid out, and clutters the head of the pages). Mainly what I'm looking at, I think, is starting the autosectioning from level 2 down - which could be done as navet was suggesting or perhaps imply another approach? Thanks for any info. - Don, 28 Oct. 2007

==== There seems to be a problem using SectionEdit together with Numbered Headers or Page Table Of Contents.

With Numbered Headers the headers display correctly, but SectionEdit inserts the text %block margin-top=0px% before each of the links in the contents table. I bodged this to work by inserting another preg_replace into numtoc.php to remove the offending markup, but presumably the real answer would be for sectionedit.php to spot that it is a contents table link, not a real header.

Sure, but how should the script know that? Every header in the wiki text (source) is used as a border for a section. And each header that is used as a border gets the %block margin-top=0px% which is a simple style and sets the margin. In my opinion the Numbered Headers script gets the whole header and displays it, but does not recognize when a style is applied try a header (with section edit deactivated) with e.g. %newwin% and you'll see it in the table also. - Klonk

With Page Table Of Contents the contents table is fine, but the headers are not rendered properly.

Changing the order of the Includes in config.php doesn't seem to change anything. Mark Hodson? October 09, 2005, at 08:20 AM

Currently I have tried the all 3 extensions of TOC (Page Table Of Contents, Numbered Headers, and the Quick Page Table Of Contents). All 3 of them don't work correctly with SectionEdit. This should be fixed. Other Wikis can handle both features well (just to metntion some: dokuwiki, twiki,mediawiki and there are more). Please, Can anything be done here ? Maybe one of the 3 TOC extensions should be merged with SectionEdit to give at least one working solution.

Someone noticed this and wrote Slim Table of Contents (as noted above). While I prefer a different layout (not right-justified), the css is really easy to edit, and it does work with SectionEdit.


==== I had two sites implemented. one works perfectly. the other works with a warning

 Warning: Cannot modify header information - headers already sent by (output started at 
 /data/httpd/pmwiki-2.0.12/cookbook/sectionedit.php:493) in /data/httpd/pmwiki-2.0.12/pmwiki.php on line 709

what gives? both sites have identical HTTPd/PHP

This looks like some text was output at one location and not at the other. Please check the PHP-Setting regaring showing of errors/warnings. Maybe something differs there - Klonk November 07, 2005, at 08:29 AM

You are right there, both servers have the same error message in HTTPd error_log files. One also shows the message on HTML pages. One server was using startand packages from CentOS 4.1, the other uses Whitebox Enterprise Linux 3, both are clones of Redhat Enterprise Linux 3/4. How should it be fixed? the error logs are growing ...

I have no idea... I don't have a server available that runs Linux currently, therefore it's difficult to reproduce it, as with windows and other linux server (including on my own homepage) work perfectly. FYI I locally installed PHP 4.4.0 and just changed the force_cgi-redirect setting and chnaged the reporting to show only errors and warnings, i.e. error_reporting = E_ALL & ~(E_NOTICE | E_USER_NOTICE) ; Please try and tell me whether this helps... - Klonk November 16, 2005, at 02:34 AM
I have another idea: edit sectionedit.php and remove at the very end the lines from ?> and following. The script only has 489 lines therefore I assume there are some empty lines after the ?>. As the ending ?> is not necessary anymore with PmWiki this might help (I just left it as I didn't encounter any problems yet) -Klonk November 16, 2005, at 02:38 AM

No. it does not help

I configured PHP so that NO errors/warnings show up on web pages. however, it does show in HTTP error_log file.

The 2nd trick does not work though. same errors

Hmm, very strange. I got such errors only when I added some code to display varables, but not anymore when I removed those commands. Do you have the latest version of the sectionedit script? I noticed that I forgot to remove this additional display in a former version... - Klonk November 17, 2005, at 01:31 AM

==== Hi, using php 5 and Apache 2 on Windows, I get the following errors on the page

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in C:\Program Files\Apache Group\Apache2\htdocs\pmwiki\cookbook\sectionedit.php on line 264
Warning: array_unique() [function.array-unique]: The argument should be an array in C:\Program Files\Apache Group\Apache2\htdocs\pmwiki\cookbook\sectionedit.php on line 266
Warning: in_array() [function.in-array]: Wrong datatype for second argument in C:\Program Files\Apache Group\Apache2\htdocs\pmwiki\cookbook\sectionedit.php on line 287
Warning: in_array() [function.in-array]: Wrong datatype for second argument in C:\Program Files\Apache Group\Apache2\htdocs\pmwiki\cookbook\sectionedit.php on line 287
Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\Apache Group\Apache2\htdocs\pmwiki\cookbook\sectionedit.php:264) in C:\Program Files\Apache Group\Apache2\htdocs\pmwiki\pmwiki.php on line 766

When I comment out the offending lines and references, everything seems to work ok. I don't use includes so it is not a problem for me but I thought I would raise the issue for someone to look into (I don't know any php otherwise I would!)

Also, can anyone help me move the section edit links to the bottom of the section in the latest release?

Dav Bacci 25th Jan 2006

Hi, using php 5 and Apache 2 on Mac X same problem, a php5 problem !!

Trt editing the lines that show the "array" type error by adding "(array)" in front of the offensive variable. This will cast that variable as an Array, which should fix the problem. BenWilson February 05, 2006, at 12:37 PM

Maybe you can specify this for PHP-Beginners... ;-). This here are the lines:

		$SectionEditIncludes = array_merge($SectionEditIncludes,$args['']);
		/*remove double page entries*/
		$SectionEditIncludes = array_unique($SectionEditIncludes);

what's to do? - Chris

Hi, I'm not even a beginner with PHP, but I did it this way and stopped getting those warnings:

$SectionEditIncludes = array_merge((array)$SectionEditIncludes,(array)$args['']);

		/*remove double page entries*/
		$SectionEditIncludes = array_unique((array)$SectionEditIncludes);

Jahvetti


==== SectionEdit works okay for me except under the following circumstances when the section being edited overwrites the whole page:

  1. Open an "Edit Section"
  2. Edit it
  3. Hit "Save and Edit"
  4. Hit "Cancel"

If instead, I replace (4) with: Hit "Save", then the page is saved successfully. test

(Looking at the history seems to confirm that SectionEdit deletes everything bar the section being edited on "Save and Edit", then adds it all back on "Save".)

Is this a bug or a feature? Marc 2006/06/27

Do you really have the version 2.0.3? (Please check in the PHP source) This bug should be fixed (at here the described problem does not occur). Maybe you should redownload the script, I uploaded the latest version again. -Klonk July 07, 2006, at 02:22 AM

I have exactly the same problem with PmWiki 2.1.26 and sectionedit 2.0.3. One additional information: After a "Save and Edit" the whole page is replaced by the section, which can be verified by looking at the page with an second browser. This behaviour is very dangerous and annoying, though sectionedit is a really great feature. juergen 2006/09/16
Same with sectionedit 2.0.4. An additional information might be, that I have $SectionEditWithoutHeaders = true; and $SectionEditInIncludes = false; in my local.conf. juergen 2006/09/19
OK, I'll look into it (again(. How did you do it? "Save and Edit" then "Cancel"? Because this is the only way I can reproduce it. Please try "Save and Edit" (you could try it several times) and then leave then page with "Save". Do you still only see the edited section?? - Klonk September 20, 2006, at 03:22 AM
Please download evrsion 2.0.5. Now this problem should be (finally) fixed. Please try and report. Thanks. - Klonk September 20, 2006, at 04:03 AM
Tested with 2.0.5 and 2.1.0, both work fine. Many thanks ! juergen 2006/09/21
Jipieh!! Thanks for the report. So I finally found the bug! - Klonk September 21, 2006, at 08:46 AM
Found one little problem with 2.1.0, worked with 2.0.5, though. Preview dosn't work. Fixed it by removing the comment-character (#) in line 457. juergen 2006/09/22
Uups optimized too much, I fixed it in version 2.1.1 (with another improvement/bugfix) and uploaded it again - Klonk September 22, 2006, at 03:00 AM

In my installation (German) a bug appears, when I activate sectionedit. The second heading is no longer displayed as a heading, but with exclamation marks. If I insert an exclamationmark in the lines between all is okey. If I add &action=test all is also working If I use preview the same Only without action this problem is there?? Pages with headings created without sectionedit on are also displayed right, even if it is on! Many greetings hh(at)11h.de (4.Juli.2006) my testcode:

test

test this line is no heading any longer

mORE TESTING

mORE TESTING

test

Do you really have the version 2.0.3? (Please check in the PHP source) This bug should be fixed (at here the described problem does not occur). Maybe you should redownload the script, I uploaded the latest version again. -Klonk July 07, 2006, at 02:22 AM

I am using version 2.1.3 of this cookbook and pmwiki-2.1.26. I have the same problem that my second heading is without formating. 2006-12-10 k2s?

==== Hi. First of all, thanks for your great extension!

Now, it also happens to me the thing of "SectionEdit deletes everything bat the section being edited". Using version, 2.0.3. This is not so bad.

The problem is, if I get to a sectioned page through eg. Main.mypage it works perfect, but, if I get to the page through Main.mypage?action=view , the "edit section" links do not appear. This I checked it consistently through various pages.

Any idea to fix this? Inigo August 11, 2006, at 10:51 AM

Use "Main.mypage?action=browse" then it works. Pm has changed this somewhen in the past. If you want to work it also with vie go to the end of sectionedit.php and locate "$action == 'browse'". Replace it with "$action == 'browse' | $action == 'view'" - Klonk September 18, 2006, at 08:35 AM
Works now in version 2.0.4 - Klonk September 18, 2006, at 09:02 AM

Thanks, that was it! Inigo? October 04, 2006, at 05:16 PM


==== August 20 2006

Hello,

I tried sectionedit with logon status:

(:if authid:)====(:ifend:)

and when I try to edit the section, it is empty (while it is not without the conditional markup). Any idea ?

Nicolas, August 20, 2006, at 02:11 PM

Put "====" in a new line - Klonk September 18, 2006, at 08:35 AM
Sinces version 2.1.0 (:if auth edit:)<link to edit section>(:ifend:) is default. I.e. editlinks are only visible when you are allowed to edit the text. If you have no right to edit the text the section-editlinks are confusing. Comments on that? - Klonk September 21, 2006, at 02:51 AM
It might happen that you get an empty edit box when doing the above example, I fixed this with version 2.1.1 - Klonk September 22, 2006, at 04:41 AM

Could this be made optional? For pages that I always edit, I have to choose to edit the entire page (to enter my password), then go back to select the section. I'd like to do this optionally per page, or site.


==== Found a new bug, introduced around 2.1. If the first line of a page is a heading I get a line like (:sectionedit Main.Test Main.Test:) at the top of the page. Insert something other above the heading to fix that. Tested with sectionedit 2.1.2 and a fresh install of pmwiki 2.1.26, no other cookbook extensions installed. juergen 2006/09/23 This is fixed with version 2.1.3. I had to change regex more than I thought it is necessary. - Klonk September 24, 2006, at 01:14 AM

I have a similar problem (using pmwiki-2.2.0-beta58 and section edit 2.1.3). I also get a line like (:sectionedit Articles.TestGerman Articles.Test:) if the first line of a page is a heading or contains a footnote (created using the extendmarkup.php). Torsten July 20, 2007, at 02:26 PM Besides I just discovered that ((:nosectionsinincludes:) doesn't work for me. And I found out that the sectionedit works for the section that comes BEFORE the "Edit Section↓" when it is in an included page. i.e. on the page Test it works correctly (it works for the section that comes AFTER "Edit Section↓") whereas it modifies the section that comes BEFORE if the page Test is included on another page using (:include Test:). And as decribed further down in this discussion the second heading is not rendered as heading but displays with two exclamation in front of it (both on included and not included pages). But when I click on the "Edit Section↓" next to that second (not rendered) heading on pages that are included it doesn't open the markup for the section that comes before or after the "Edit Section↓" but the edit-markup for the whole included page. I hope anyone finds this information useful. Torsten July 20, 2007, at 02:58 PM

I have the same issue, thank you for the work around. jtankers October 3, 2007


==== I am using SectionEdit with RequireAuthor. I find that when the unsuspecting author tries to edit and then save one section (using SectionEdit's 'Edit Section') without entering an author name, the message is displayed up on top saying the author name is required but in the edit window, the text for the whole page is loaded so when she does save it correctly she duplicates the whole page in the place just that section should be. I'm running a huge wiki for a University MBA program and I don't want to remove either the Edit Section functionality or the Require Author functionality.

CCharles?

Do I assume correctly, that you mean the RequireAuthor setting in the config? What do you do exactly? "Save" or "Save and Edit" ? Please provide an exact procedure how to reproduce this problem, as it works here on my local installation. Do you use the latest version? - Klonk October 09, 2006, at 03:48 PM

sectionedit ate my form!

I believe that I've found a bug in sectionedit (v2.1.3 - 2006-09-22)

The following markup and template should produce a list of radio buttons - one for each group - and a button; all within a form, naturally.

Page markup:

  (:pagelist fmt=#grpradio:)

  some more text

Local template

  !!!fmt=#grpradio

  list of all the group names

  
  [[#grpradio]]
  (:if equal {<$Group} :)
  (:input form "{$PageUrl}":)
  (:if ! equal {<$Group} {=$Group} :)
  * (:input radio n {=$Group}:) {=$Group}
  (:if equal {>$Group} :)
  (:input submit value="Try It":)
  (:input end:)
  (:if:)
  [[#grpradioend]]

However, with sectionedit.php active, the <form> is absent from the HTML.

With sectionedit.php:

  <div class='vspace'></div><div class='fpltemplate'></div>
  <p class='vspace'>some more text
  </p>
  </div>

Without sectionedit.php:

  <div class='vspace'></div><div class='fpltemplate'>
  <form action='[(approve links)
  edit
  diff]' method='post'>
  <ul><li><input type='radio' name='n' value='Main' /> Main
  </li><li><input type='radio' name='n' value='PmWiki' /> <span class='wikiword'>PmWiki</span>
  </li><li><input type='radio' name='n' value='Site' /> Site
  </li></ul><p><input type='submit' value='Try It' class='inputbutton' />
  </p></form>
  </div>
  <p class='vspace'>some more text
  </p>
  </div>

To further test this, I installed a new version of PmWiki, with only the necessary changes to run the above test and the problem remained.

One more thing: the <form> displays correctly when previewing the edit

Marc November 22, 2006, at 07:36 AM

Is there an opposite directive to (:nosections:)?

I really like this recipe. Once in a while I need to disable the feature using (:nosections:), so I wonder if it is possible to do something like this:


!! Section ...
bla bla

(:nosections:)
...
(:sections:) 
!! Section

where the imagined new directive (:sections:) enables editing of sections again. Btw, it should probably be called something other than (:sections:).

best regards, Christian


====

Note

My Pmwiki (ver.2.1.27) have a problem with the sectionedit-script(ver.2.1.3)

With the Button {Save&Edit} don't have any problems, but only {Save} ,however the userrights are set, the script brings the Abort-Messages from pmwiki.php (function ResolvePageName):

PmWiki can't process your request

?invalid page name

We are sorry for any inconvenience.

So must refresh the browser and the script works fine!

The Problem is only in IE6 and Windows-Explorer actual, MozillaFirefox and IE7 don't have any problems with the script!!!

Have any pmwiki-user the same problem?

Thanks for answers!!! -Kai- 04.04.07

Note: This problem exists only with IIS-Webserver, with Apache the script works fine!! -Kai- 13.04.07

==> kai - i have the same setup and am using ie6 at work so unable to update to ie7. using the same script on a different setup works fine with ie7. would appreciate any assistance to get round the problem thanks david 12/05/07


Is it possible to avoid the "Section Edit" labels when printing ?

==== Hi, Klonk I really appreciate your script, but something annoying is that if I print my page, the "Section Edit" labels appear on the printed page. Is there any means to change the CSS or something else to avoid that? I have never changed any CSS, thus please could you give me all the instruction if it is the way to solve the problem. PhilB? April 28, 2007, at 12:01 AM

See above "translateable strings". Simply Change the "translation" for your local installation - Klonk May 23, 2007, at 06:42 AM
You can use the @media print CSS definition above. "Translating" the strings will also change them in normal mode which is probably not what you wish. --Petko May 24, 2007, at 12:09 AM

Hi,

I have hit a bug which destroys the formatting of all sections except the one you are editing.

  1. Create a page with multiple sections
  2. Edit one section and make any change
  3. Save the document
  4. The section you edited is okay, but the linefeeds disappear from all other sections.

I think this is browser dependent: it only happens when I use w3m (a text-based browser which opens a text editor when you edit textareas).

I am using: pmwiki 2.1.27, sectionedit 2.1.6, w3m 0.5.1 (on Linux), vim 6.3 . I was using other extensions but I disabled them all and I still get the bug.

I can't reproduce the bug using lynx, Safari or Firefox. I can mail "before and after" versions of a page that demonstrates the bug from my wiki.d directory if you want.

Editing the entire page (with the edit link at the top) works fine. It is just the "Edit this section" bits that break things.

-- Paul Nijjar


Question:SectionEdit not work with Glossary?

--R. Serra

SectionEdit simultaneos edit incompatibility

Hello! My wiki configuration

 FreeBSD 6.2 (Virtual Private Server)
 apache-2.2.6_2
 php5-5.2.4_1 
 PmWiki Version: pmwiki-2.2.116
 PmWiki VersionNum: 2002116
 SectionEdit: 2.1.6
 No other cookbook recipes
  1. Open up two browser windows and select the same section of a page to be edited in each window.
  2. In one browser window, make some changes. Save those changes.
  3. In the second browser window, make some different changes to the same section and hit "save". You see simultaneous edit message, but the edit form shows only the section had been edited -- not the whole page as expected. If you hit "save" the corrections made in the first window are lost (but you can see them in history).

You can see the bug at [(approve links) edit diff]

-- Pavel


Issue with Categories (SH - 6 Dec 2007)

> When categories is used the first time and saved by sectionedit, the > click on categories does not generate the list of pages corresponding > to this category, ... the entire page must be saved to produce the expected > result. > Bug ?

''comment from PM I think so. The SectionEdit recipe appears to be overriding PmWiki's default edit sequence, such that the pageindex isn't updated properly whenever the page is updated.

Well in fact I simply took the handleedit function and modified it a little bit. Modification was simply done to additionally handle $prechunk and $postchunk (the parts before and after the actual edited section) and to split/combine the page text. To be honest I have no clue where from within the original Handledit function this update of the pageindex is called Klonk December 07, 2007, at 12:06 PM

Bug in parameter handling

There's a bug in the parameter handling code for includes in this recipe.

Line 308:

/* keeps all parameters but pagenames*/
foreach($args as $k => $v) $argsparam = ($k != '#' && !is_array($v) ) ? " ".$k."=".$v : "";

This deletes all parameters except for the last one! The correct code is:

/* keeps all parameters but pagenames*/
$argsparam = '';
foreach($args as $k => $v) $argsparam .= ($k != '#' && !is_array($v) ) ? " ".$k."=".$v : "";

-- Ivo

fixed in version 2.1.8. Thanks - Klonk March 03, 2008, at 10:11 AM

I wish "section edit button" append to heading text.

example code)

<h2>This is heading level-2 text. <a href="...">Edit Section</a> </h2>
...

How edit this recipe code? or Anyone help me to offer $var?

thanks your regards. from Hooney / 2008-02-19


Hey, thanks for the great work.\\ I think I've found a bug though, (maybe).
In our setup we are using ExternAuth and it seems to be working just fine.
BUT
if a person has edit sections in a page and has also specified a list of users/groups who can edit that page they are the only ones who can view it as well.
So, when you say click on a profile for instance that has edit sections but the author has restricted editing and you're not in the group then you're disallowed from viewing the page.
Even more interestingly, even though you clicked view it's trying to escalate your privs to edit.
What I was wondering was, is it possible to only invoke edit when a person clicks on edit section and/or hid the edit section link if they only have view privs?

Thank you,

Frederick
-- Fixed my own issue :)
UTSL
had to uncomment
if (!CondAuth($pagename, 'edit'))
return ($text);
This allows them to view the page but NOT edit
And when they click on the Edit Section link they get an edit denied
Will look into hiding edit section link if not allowed to edit


Hi,

I am using this sectionedit.php recepie but it doesn't seem to working for me. After I include this recepie in my config.php file and try to access the site, all I can see are blank pages and when I comment out the "include(..)" from confid.php, site works fine. any idea why that would happen.

Thanks in advance for the help.


There is another limitation to sectionedit.
Generating sections only for the main wiki page is completely okay, but: If the main wiki page has no header / horzline / ==== there won't be sections for included pages as well.
Tontyna / January 26, 2009


To have a simple TOC that works with sectionedit use SlimTableOfContents Tontyna / February 1, 2009

is QuickPageTableOfContents not compatible? seems to be working for me. What are the symptoms of incompatibility in other TOCs? DavidBessler March 06, 2009, at 01:56 AM
Versions 2.1 didn't work correctly (see comment some paragraphs above). I didn't check the other TOC recipes after rewriting SectionEdit so maybe as a by-product Version 2.2 fixed that incompatbility. Tontyna March 18, 2009, at 05:44 PM

I'm running pmwiki-2.1.27, which doesn't have UpdatePage(), which is used by this recipe. I'm not sure what the real prereq for sectionedit is. Peter Kay / Feb 18, 2009


Try a 2.1.x version of the recipe. I don't know which x is compatible with pmwiki-2.1.27, but they are all contained in the Development-Archive .
Of course they'll miss features and bugfixes introduced with newer versions...may I ask why you don't upgrade your pmwiki? - Tontyna February 23, 2009, at 05:27 PM


Bug with ==== ??

farhad March 03, 2009, at 10:06 PM:

I'm on version 2.2.0 and using SectionEdit with markup ==== to identify sections. If a page has multiple sections:

  • Edit a section using Edit Section link
  • Save page

It removes trailing white spaces from the section before. This makes the next ==== NOT appear in a new line any more and I lose an Edit Section link because the ==== markup needs to be in it's own line for it to work. Any workaround??

Updates:

I found this happening in Safari, but works fine in Firefox.

Only to be shure: You don't use headings for sectioning? Cause if you use !!! and they behave well it would be a mystery to me.... gimmi a few days to set up PmWiki on my Mac to check this out. (Didn't realize that browsers might apply their own rules on POST vars.) - Tontyna March 05, 2009, at 04:01 AM
Fixed in Version 2.2.2
Workaround would be to insert manually a newline at the beginning of the section you edit - in front of the ====.
- Tontyna March 07, 2009, at 03:12 AM
Thanks
Thanks for the update. I also found the workaround, and have been using it for a while now. Will consider upgrading to 2.2.2 soon.
- farhad June 02, 2009, at 03:00 PM
Beautiful
Upgraded to 2.2.2 and this issue disappeared magically. Thank you!
- farhad November 05, 2009, at 02:44 PM

====

Blank space at the top of the page

If I use the SectionEdit recipe with the config setting "$SectionEditHeaderLinkSpan = false;" then I get a large whitespace area at the top of the document, and the first link is about two thirds of the way down the screen. I've tried playing around with the php, but I'm no expert so can't work out why it's happening. If I set it to 'true' then I don't get the problem, but I prefer the TOC recipe to SlimTOC, so would rather stick with TOC and turn off the header link span. Any idea why the blank space is appearing, and how I can get rid of it, as this would be an incredibly useful recipe if I can get it to work! MichaelF April 20th 2009

I can't reproduce this behaviour. When $SectionEditHeaderLinkSpan is turned off the edit-link is just moved into a div (class='sectionedit sectionhead') in front of the heading. So maybe it's a css problem?
Or maybe it's a conflict in the markup chain? I don't know when the TOC recipe grabs the headings and what assumptions it makes about them - I didn't do any pmwiki stuff for weeks and I'm fast in forgetting, but one thing I remember is that linking markup into the markup table is easy, but there is no guarantee that you don't kill other recipies workflow. - Tontyna May 08, 2009, at 02:28 PM

==== Sectionedit link floating when including a single div
When I include a page with only a div, there is a sectionedit link floating on the line where the include was. Is there any way to remove this section edit link, without removing all sections. Preferably, if possible, without having to put a directive on that page, because this include will be done on quite a few pages (so that would require the directive on all those pages). Thanks Patrigan?

Apparantly, this has some other side-effects. When including a page with wiki variables, any variable with a space in between, like name="Has Space" will be truncated to tjhe first space: "Has" The Space part dissappears in thin air. Patrigan?

==== SectionEdit makes all wiki pages blank
Not sure how to put this any other/better way: When I run SectionEdit, the whole wiki breaks - nothing on any page, just plain blank pages for all. Not sure why this is.

Other plugins running on said wiki: quicktoc, pagetoc, mini, multiupload, enablehtml, LaTeXMathML, uploadform. I've alternately tried break-page and SectionEdit - the latter breaks the wiki, the former creates "edit section" links but those lead nowhere. Help!? ~Kunal?

What you need to do is figure out what in your config.php is causing this. I would suggest commenting out (/* ... */ style comments are your friend because you can encompass many lines with them) various parts of the config.php that you have added and see what makes it work. Leave SectionEdit in and see what else is causing it. Be aware that other recipes or the order of instructions in config.php can have an impact on an otherwise well-behaved recipe... --Peter Bowers July 27, 2010, at 01:50 AM
Thanks Peter. It was my mistake - I didn't have the two dependencies satisfied :/. Just as a general question anyway - what's the best place to put the include_once directive in the config file? Happy to report, though, that this plugin works fine with pmwiki-latest! ~Kunal?
See LocalCustomizations#configphp-order for rules regarding the order of config.php instructions.

Talk page for the SectionEdit recipe (users).