You are here: Foswiki>Tasks Web>Item9830 (02 Dec 2010, AndreasKeil)Edit Attach

Item9830: EditChapterPlugin does not work with Foswiki 1.1.0

Priority: Urgent
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: EditChapterPlugin
Reported By: NeilMcKett
Waiting For:
Last Change By: AndreasKeil

While reviewing a test installation of Foswiki 1.1.0 I have found that EditChapterPlugin no longer works because of changes to the Foswiki core. It appears that a function 'takeOutblocks' has been moved from to and so invocations via Render no longer work.

In for 1.0.9 we have calls via

    $text = $this->renderer->takeOutBlocks( $text, 'verbatim', $verbatim );
    $text = $this->renderer->takeOutBlocks( $text, 'pre',      $verbatim );
    $text = $this->renderer->takeOutBlocks( $text, 'verbatim', $verbatim );
    $text = $this->renderer->takeOutBlocks( $text, 'verbatim', $verbatim );
    $text = $this->renderer->takeOutBlocks( $text, 'verbatim', $verbatim );

whereas in for 1.1.0 the function is defined within the calling module rather than

    $text = takeOutBlocks( $text, 'verbatim', $verbatim );
    $text = takeOutBlocks( $text, 'dirtyarea', $dirtyAreas )
    $text = takeOutBlocks( $text, 'verbatim', $verbatim );
    $text = takeOutBlocks( $text, 'dirtyarea', $dirtyAreas )
    $text = takeOutBlocks( $text, 'verbatim', $verbatim );

EditChapterPlugin uses $text = $this->renderer->takeOutBlocks... so fails with the Foswiki 1.1.0 core.

-- NeilMcKett - 15 Oct 2010

According to the #foswiki log of 2010-11-30 from 03:59 to 04:21, the plugin was fixed but still does not work on newer Foswiki installations - I'm using 1.1.2. Are there any updates to this issue?

(Raising the priority to 'urgent' and setting the WaitingFor field as recommended in the same chat conversation...)

-- AndreasKeil - 30 Nov 2010

The takeOutBlocks is now called using a wrapper that detects the differences between the various foswiki engines.

There was another error related to the last minute changes to %ADDTOZONE in the core of foswiki-1.1 as well as ZonePlugin that now was fixed in the latest EditChapterPlugin release 2.13.

Please have a try.

-- MichaelDaum - 30 Nov 2010

I upgraded to the new release of EditChapterPlugin and now everything seems to work fine smile Thank you for this really quick response! Feel free to close this Item.

However, I have another question (not to be considered a bug report): Editing a section using the EditChapterPlugin, results in the immediatly following text to be edited. I.e., it does not include text at lower hierarchy levels. However, i believe that all content grouped under a heading belongs to this heading. This means that for a document structure like

foo text
bar text

I would like to see the complete text (including the h2 "Bar" heading and the "bar text") instead of just the h1 heading and the "foo text" to be part of the editing process when clicking on the h1 "Foo" heading. Wouldn't that be more logical? If yes, are there technical limitations that prevent EditChapterPlugin from behaving this way?

-- AndreasKeil - 30 Nov 2010

I think you will find many people using a H1 headline at the top of the topic and then only H2 and maybe H3 in the rest of the document so I would be very careful how to change this.

I do not use this plugin in my installations. This was just a "service remark" to be considered

-- KennethLavrsen - 30 Nov 2010

My comment was not tied to the H1 level. It's similarly valid for a structure like
---+ Topic Heading

---++ Section A

---+++ Subsection A.1

---+++ Subsection A.2
In this case, I would personally prefer if a click on "Section A" would let me edit the whole content of "Section A", including its two subsection. But the current implementation of the plugin lets me edit the "Section A" heading and the "Foo" text only. Compare this to MediaWiki's behavior of allowing the whole content of a heading to be edited.

Actually, if a user limits the depth by setting EDITCHAPTERPLUGIN_MAXDEPTH = 2, she would not be able to edit the text "Bar" using the edit links provided by EditChapterPlugin at all. She would have to revert to editing the full article instead.

Therefore, I would suggest to include all nested sections in a chapter edit. What do you think?

Unfortunately, I am a total novice and probably can't help with the implementation. I would totally understand if this "feature request" is not implemented.

-- AndreasKeil - 02 Dec 2010
Topic revision: r10 - 02 Dec 2010, AndreasKeil
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy