Uploaded image for project: 'MediaWiki tools'
  1. MediaWiki tools
  2. MEDIAWIKI-53

Image link without file reference is crashing the import

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.8
    • Fix Version/s: 1.8
    • Component/s: Filter
    • Labels:
      None
    • Similar issues:

      Description

      The following media wiki syntax:

      [[Image:|centre]]
      

      is crashing the import with the following exception:

      An Entity Reference name cannot be null or empty
      class org.xwiki.filter.FilterException: Failed to parse XML
          at org.xwiki.filter.mediawiki.xml.internal.input.MediaWikiInputFilterStream.read(MediaWikiInputFilterStream.java:257)
          at org.xwiki.filter.mediawiki.xml.internal.input.MediaWikiInputFilterStream.read(MediaWikiInputFilterStream.java:81)
          at org.xwiki.filter.input.AbstractBeanInputFilterStream.read(AbstractBeanInputFilterStream.java:79)
          at org.xwiki.filter.internal.job.FilterStreamConverterJob.runInternal(FilterStreamConverterJob.java:100)
          at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:206)
          at org.xwiki.job.AbstractJob.run(AbstractJob.java:189)
          at org.xwiki.filter.script.internal.ScriptFilterStreamConverterJob.run(ScriptFilterStreamConverterJob.java:75)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
          at java.lang.Thread.run(Thread.java:745)
      Caused by: class org.xwiki.filter.FilterException: Failed to convert content page
          at org.xwiki.filter.mediawiki.xml.internal.input.MediaWikiInputFilterStream.convertToXWiki21(MediaWikiInputFilterStream.java:573)
          at org.xwiki.filter.mediawiki.xml.internal.input.MediaWikiInputFilterStream.readPageRevision(MediaWikiInputFilterStream.java:507)
          at org.xwiki.filter.mediawiki.xml.internal.input.MediaWikiInputFilterStream.readPage(MediaWikiInputFilterStream.java:378)
          at org.xwiki.filter.mediawiki.xml.internal.input.MediaWikiInputFilterStream.readMediaWiki(MediaWikiInputFilterStream.java:298)
          at org.xwiki.filter.mediawiki.xml.internal.input.MediaWikiInputFilterStream.read(MediaWikiInputFilterStream.java:286)
          at org.xwiki.filter.mediawiki.xml.internal.input.MediaWikiInputFilterStream.read(MediaWikiInputFilterStream.java:255)
          at org.xwiki.filter.mediawiki.xml.internal.input.MediaWikiInputFilterStream.read(MediaWikiInputFilterStream.java:81)
          at org.xwiki.filter.input.AbstractBeanInputFilterStream.read(AbstractBeanInputFilterStream.java:79)
          at org.xwiki.filter.internal.job.FilterStreamConverterJob.runInternal(FilterStreamConverterJob.java:100)
          at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:206)
          at org.xwiki.job.AbstractJob.run(AbstractJob.java:189)
          at org.xwiki.filter.script.internal.ScriptFilterStreamConverterJob.run(ScriptFilterStreamConverterJob.java:75)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
          at java.lang.Thread.run(Thread.java:745)
      Caused by: class java.lang.IllegalArgumentException: An Entity Reference name cannot be null or empty
          at org.xwiki.model.reference.EntityReference.setName(EntityReference.java:187)
          at org.xwiki.model.reference.EntityReference.<init>(EntityReference.java:155)
          at org.xwiki.filter.mediawiki.xml.internal.input.MediaWikiInputFilterStream.toFileEntityReference(MediaWikiInputFilterStream.java:233)
          at org.xwiki.filter.mediawiki.xml.internal.input.MediaWikiContextConverterListener.refactor(MediaWikiContextConverterListener.java:175)
          at org.xwiki.filter.mediawiki.xml.internal.input.MediaWikiContextConverterListener.beginLink(MediaWikiContextConverterListener.java:200)
          at org.xwiki.rendering.listener.WrappingListener.beginLink(WrappingListener.java:203)
          at org.xwiki.contrib.mediawiki.syntax.internal.parser.converter.LinkEventGenerator.begin(LinkEventGenerator.java:33)
          at org.xwiki.contrib.mediawiki.syntax.internal.parser.converter.AbstractEventGenerator.traverse(AbstractEventGenerator.java:87)
          at org.xwiki.contrib.mediawiki.syntax.internal.parser.converter.EventConverter.traverse(EventConverter.java:416)
          at org.xwiki.contrib.mediawiki.syntax.internal.parser.converter.EventConverter.traverse(EventConverter.java:384)
          at org.xwiki.contrib.mediawiki.syntax.internal.parser.converter.EventConverter.traverse(EventConverter.java:362)
          at org.xwiki.contrib.mediawiki.syntax.internal.parser.converter.EventConverter.traverse(EventConverter.java:351)
          at org.xwiki.contrib.mediawiki.syntax.internal.parser.converter.AbstractEventGenerator.traverse(AbstractEventGenerator.java:90)
          at org.xwiki.contrib.mediawiki.syntax.internal.parser.converter.ParagraphEventGenerator.traverse(ParagraphEventGenerator.java:47)
          at org.xwiki.contrib.mediawiki.syntax.internal.parser.converter.EventConverter.traverse(EventConverter.java:416)
          at org.xwiki.contrib.mediawiki.syntax.internal.parser.converter.EventConverter.traverse(EventConverter.java:384)
          at org.xwiki.contrib.mediawiki.syntax.internal.parser.converter.EventConverter.traverse(EventConverter.java:362)
          at org.xwiki.contrib.mediawiki.syntax.internal.parser.converter.EventConverter.traverse(EventConverter.java:351)
          at org.xwiki.contrib.mediawiki.syntax.internal.parser.converter.EventConverter.nodesToText(EventConverter.java:227)
          at info.bliki.wiki.model.AbstractWikiModel.render(AbstractWikiModel.java:1244)
          at org.xwiki.contrib.mediawiki.syntax.internal.input.MediaWikiSyntaxInputFilterStream.read(MediaWikiSyntaxInputFilterStream.java:103)
          at org.xwiki.contrib.mediawiki.syntax.internal.input.MediaWikiSyntaxInputFilterStream.read(MediaWikiSyntaxInputFilterStream.java:46)
          at org.xwiki.filter.input.AbstractBeanInputFilterStream.read(AbstractBeanInputFilterStream.java:79)
          at org.xwiki.filter.mediawiki.xml.internal.input.MediaWikiInputFilterStream.convertToXWiki21(MediaWikiInputFilterStream.java:571)
          at org.xwiki.filter.mediawiki.xml.internal.input.MediaWikiInputFilterStream.readPageRevision(MediaWikiInputFilterStream.java:507)
          at org.xwiki.filter.mediawiki.xml.internal.input.MediaWikiInputFilterStream.readPage(MediaWikiInputFilterStream.java:378)
          at org.xwiki.filter.mediawiki.xml.internal.input.MediaWikiInputFilterStream.readMediaWiki(MediaWikiInputFilterStream.java:298)
          at org.xwiki.filter.mediawiki.xml.internal.input.MediaWikiInputFilterStream.read(MediaWikiInputFilterStream.java:286)
          at org.xwiki.filter.mediawiki.xml.internal.input.MediaWikiInputFilterStream.read(MediaWikiInputFilterStream.java:255)
          at org.xwiki.filter.mediawiki.xml.internal.input.MediaWikiInputFilterStream.read(MediaWikiInputFilterStream.java:81)
          at org.xwiki.filter.input.AbstractBeanInputFilterStream.read(AbstractBeanInputFilterStream.java:79)
          at org.xwiki.filter.internal.job.FilterStreamConverterJob.runInternal(FilterStreamConverterJob.java:100)
          at org.xwiki.job.AbstractJob.runInContext(AbstractJob.java:206)
          at org.xwiki.job.AbstractJob.run(AbstractJob.java:189)
          at org.xwiki.filter.script.internal.ScriptFilterStreamConverterJob.run(ScriptFilterStreamConverterJob.java:75)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
          at java.lang.Thread.run(Thread.java:745)
      

      Note that this only reproduces if the import is configured to not attach files to pages.

        Attachments

          Activity

            People

            • Assignee:
              lucaa Anca Luca
              Reporter:
              lucaa Anca Luca
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: