Uploaded image for project: 'XWiki Rendering'
  1. XWiki Rendering
  2. XRENDERING-583

Inline Wysiwyg Editing of WikiMacro inside WikiMacro fails

    XMLWordPrintable

    Details

    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      I created 2 macros to wrap wiki syntac inside a bootstrap row and a bootstrap column.
      When inserting a column in a row and editing in wysiwyg the content of the column and exception is raised on saving "Bad Request".

      The error on the server is

      Caused by: org.xwiki.rendering.parser.ParseException: Failed to parse input source
      	at org.xwiki.rendering.internal.parser.wikimodel.AbstractWikiModelParser.parse(AbstractWikiModelParser.java:132)
      	at org.xwiki.rendering.internal.parser.xhtml.XHTMLParser.parse(XHTMLParser.java:217)
      	at org.xwiki.rendering.internal.parser.wikimodel.AbstractWikiModelParser.parse(AbstractWikiModelParser.java:108)
      	at org.xwiki.rendering.internal.parser.xhtml.XHTMLParser.parse(XHTMLParser.java:208)
      	at org.xwiki.wysiwyg.internal.converter.DefaultHTMLConverter.fromHTML(DefaultHTMLConverter.java:145)
      	... 48 common frames omitted
      Caused by: org.xwiki.rendering.wikimodel.WikiParserException: java.lang.ClassCastException: org.xwiki.rendering.internal.renderer.xwiki21.XWikiSyntaxRenderer cannot be cast to org.xwiki.rendering.listener.WrappingListener
      	at org.xwiki.rendering.wikimodel.xhtml.XhtmlParser.parse(XhtmlParser.java:134)
      	at org.xwiki.rendering.internal.parser.wikimodel.AbstractWikiModelParser.parse(AbstractWikiModelParser.java:130)
      	... 52 common frames omitted
      Caused by: java.lang.ClassCastException: org.xwiki.rendering.internal.renderer.xwiki21.XWikiSyntaxRenderer cannot be cast to org.xwiki.rendering.listener.WrappingListener
      	at org.xwiki.rendering.internal.parser.xhtml.wikimodel.XWikiMacroHandler.getRenderedContentFromMacro(XWikiMacroHandler.java:184)
      	at org.xwiki.rendering.internal.parser.xhtml.wikimodel.XWikiMacroHandler.handleEnd(XWikiMacroHandler.java:221)
      	at org.xwiki.rendering.internal.parser.xhtml.wikimodel.XWikiSpanTagHandler.end(XWikiSpanTagHandler.java:87)
      	at org.xwiki.rendering.wikimodel.xhtml.handler.TagHandler.endElement(TagHandler.java:85)
      	at org.xwiki.rendering.wikimodel.xhtml.impl.TagContext.endElement(TagContext.java:81)
      	at org.xwiki.rendering.wikimodel.xhtml.impl.TagStack.endElement(TagStack.java:123)
      	at org.xwiki.rendering.wikimodel.xhtml.impl.XhtmlHandler.endElement(XhtmlHandler.java:201)
      	at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:570)
      	at org.xwiki.rendering.wikimodel.xhtml.filter.XHTMLWhitespaceXMLFilter.sendInlineEvent(XHTMLWhitespaceXMLFilter.java:302)
      	at org.xwiki.rendering.wikimodel.xhtml.filter.XHTMLWhitespaceXMLFilter.sendPreviousContent(XHTMLWhitespaceXMLFilter.java:291)
      	at org.xwiki.rendering.wikimodel.xhtml.filter.XHTMLWhitespaceXMLFilter.flushContent(XHTMLWhitespaceXMLFilter.java:332)
      	at org.xwiki.rendering.wikimodel.xhtml.filter.XHTMLWhitespaceXMLFilter.flushContent(XHTMLWhitespaceXMLFilter.java:314)
      	at org.xwiki.rendering.wikimodel.xhtml.filter.XHTMLWhitespaceXMLFilter.endElement(XHTMLWhitespaceXMLFilter.java:183)
      	at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:570)
      	at org.xwiki.rendering.wikimodel.xhtml.filter.AccumulationXMLFilter.endElement(AccumulationXMLFilter.java:86)
      	at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:570)
      	at org.xwiki.rendering.wikimodel.xhtml.filter.DTDXMLFilter.endElement(DTDXMLFilter.java:86)
      

      The request content is the folllowing

      {"Données de formulaire":{"form_token":["H6NEu2lT2IxDw3uySvY85g","H6NEu2lT2IxDw3uySvY85g"],"x-maximized":"","parent":"WebHome","title":"BootstrapRowMacro","template":"","xcontinue":"/xwiki/bin/edit/XWiki/BootstrapRowMacro?editor=wysiwyg","xredirect":"","language":"fr","content":"<!DOCTYPE+html+PUBLIC+\"-//W3C//DTD+XHTML+1.0+Strict//EN\"+\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\r\n<html+xmlns=\"http://www.w3.org/1999/xhtml\"+xml:lang=\"fr\"+lang=\"fr\"><body><p>This+macro+is+used+to+display+a+bootstrap+row.+It+should+be+used+with+the+<!--startwikilink:false|-|doc|-|BootstrapColMacro--><span+class=\"wikilink\"><a+href=\"/xwiki/bin/view/XWiki/BootstrapColMacro\">col+macro</a></span><!--stopwikilink-->.</p><!--startmacro:row|-||-|{{col+classes=\"col-sm-6\"}}\r\n==+Column+1+==\r\n\r\nAA\r\n{{/col}}{{col+classes=\"col-sm-6\"}}\r\n==+Column+2+==\r\n++\r\nBB\r\n{{/col}}++--><div+data-xwiki-non-generated-content=\"java.util.List&lt;org.xwiki.rendering.block.Block&gt;\"+data-xwiki-wikimacrocontent=\"true\"+class=\"xwiki-metadata-container\"><p><!--startmacro:col|-|classes=\"col-sm-6\"|-|==+Column+1+==\r\n\r\nAA--><!--stopmacro--></p><div+class=\"col-sm-6\"><h2+id=\"HColumn1\"+class=\"wikigeneratedid+wikigeneratedheader\"><span+data-xwiki-non-generated-content=\"java.util.List&lt;org.xwiki.rendering.block.Block&gt;\"+data-xwiki-wikimacrocontent=\"true\"+class=\"xwiki-metadata-container\"><span>Column+1</span></span></h2><p><span+data-xwiki-non-generated-content=\"java.util.List&lt;org.xwiki.rendering.block.Block&gt;\"+data-xwiki-wikimacrocontent=\"true\"+class=\"xwiki-metadata-container\">AAC</span></p></div><!--stopmacro--><!--startmacro:col|-|classes=\"col-sm-6\"|-|==+Column+2+==\r\n++\r\nBB--><!--stopmacro--><div+class=\"wikimodel-emptyline\"></div><p>&nbsp;</p></div><!--stopmacro--><p>&nbsp;</p></body></html>","RequiresHTMLConversion":"content","content_syntax":"xwiki/2.1","content_cache":"","action_saveandcontinue":"Enregistrer","xeditaction":"edit","comment":"","defaultLanguage":"fr","syntaxId":"xwiki/2.1","xhidden":"0","previousVersion":"13.1","editingVersionDate":"2020-04-03T12:35:44.593Z","isNew":"false","minorEdit":"1","ajax":"true"},"Transmission de la requête":{"EDITOR_CONFIG":{"text":"form_token=H6NEu2lT2IxDw3uySvY85g&form_token=H6NEu2lT2IxDw3uySvY85g&x-maximized=&parent=WebHome&title=BootstrapRowMacro&template=&xcontinue=%2Fxwiki%2Fbin%2Fedit%2FXWiki%2FBootstrapRowMacro%3Feditor%3Dwysiwyg&xredirect=&language=fr&content=%3C!DOCTYPE+html+PUBLIC+%22-%2F%2FW3C%2F%2FDTD+XHTML+1.0+Strict%2F%2FEN%22+%22http%3A%2F%2Fwww.w3.org%2FTR%2Fxhtml1%2FDTD%2Fxhtml1-strict.dtd%22%3E%0D%0A%3Chtml+xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22+xml%3Alang%3D%22fr%22+lang%3D%22fr%22%3E%3Cbody%3E%3Cp%3EThis+macro+is+used+to+display+a+bootstrap+row.+It+should+be+used+with+the+%3C!--startwikilink%3Afalse%7C-%7Cdoc%7C-%7CBootstrapColMacro--%3E%3Cspan+class%3D%22wikilink%22%3E%3Ca+href%3D%22%2Fxwiki%2Fbin%2Fview%2FXWiki%2FBootstrapColMacro%22%3Ecol+macro%3C%2Fa%3E%3C%2Fspan%3E%3C!--stopwikilink--%3E.%3C%2Fp%3E%3C!--startmacro%3Arow%7C-%7C%7C-%7C%7B%7Bcol+classes%3D%22col-sm-6%22%7D%7D%0D%0A%3D%3D+Column+1+%3D%3D%0D%0A%0D%0AAA%0D%0A%7B%7B%2Fcol%7D%7D%7B%7Bcol+classes%3D%22col-sm-6%22%7D%7D%0D%0A%3D%3D+Column+2+%3D%3D%0D%0A++%0D%0ABB%0D%0A%7B%7B%2Fcol%7D%7D++--%3E%3Cdiv+data-xwiki-non-generated-content%3D%22java.util.List%26lt%3Borg.xwiki.rendering.block.Block%26gt%3B%22+data-xwiki-wikimacrocontent%3D%22true%22+class%3D%22xwiki-metadata-container%22%3E%3Cp%3E%3C!--startmacro%3Acol%7C-%7Cclasses%3D%22col-sm-6%22%7C-%7C%3D%3D+Column+1+%3D%3D%0D%0A%0D%0AAA--%3E%3C!--stopmacro--%3E%3C%2Fp%3E%3Cdiv+class%3D%22col-sm-6%22%3E%3Ch2+id%3D%22HColumn1%22+class%3D%22wikigeneratedid+wikigeneratedheader%22%3E%3Cspan+data-xwiki-non-generated-content%3D%22java.util.List%26lt%3Borg.xwiki.rendering.block.Block%26gt%3B%22+data-xwiki-wikimacrocontent%3D%22true%22+class%3D%22xwiki-metadata-container%22%3E%3Cspan%3EColumn+1%3C%2Fspan%3E%3C%2Fspan%3E%3C%2Fh2%3E%3Cp%3E%3Cspan+data-xwiki-non-generated-content%3D%22java.util.List%26lt%3Borg.xwiki.rendering.block.Block%26gt%3B%22+data-xwiki-wikimacrocontent%3D%22true%22+class%3D%22xwiki-metadata-container%22%3EAAC%3C%2Fspan%3E%3C%2Fp%3E%3C%2Fdiv%3E%3C!--stopmacro--%3E%3C!--startmacro%3Acol%7C-%7Cclasses%3D%22col-sm-6%22%7C-%7C%3D%3D+Column+2+%3D%3D%0D%0A++%0D%0ABB--%3E%3C!--stopmacro--%3E%3Cdiv+class%3D%22wikimodel-emptyline%22%3E%3C%2Fdiv%3E%3Cp%3E%26nbsp%3B%3C%2Fp%3E%3C%2Fdiv%3E%3C!--stopmacro--%3E%3Cp%3E%26nbsp%3B%3C%2Fp%3E%3C%2Fbody%3E%3C%2Fhtml%3E&RequiresHTMLConversion=content&content_syntax=xwiki%2F2.1&content_cache=&action_saveandcontinue=Enregistrer&xeditaction=edit&comment=&defaultLanguage=fr&syntaxId=xwiki%2F2.1&xhidden=0&previousVersion=13.1&editingVersionDate=2020-04-03T12%3A35%3A44.593Z&isNew=false&minorEdit=1&ajax=true","mode":"text/html"}}}
      

      I'm attaching the 2 macro xar files

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              surli Simon Urli
              Reporter:
              ludovic Ludovic Dubost
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response: