Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-59784

Wiki import from MediaWiki images are not correctly fetched with relative links

    Details

      Description

      Root Cause: Upon import we move referenced images to a new page "SharedImages," and create a relative URL within the original page. We did not protect for the imported relativeURLs, and so the image links are broken.

      Steps to reproduce:
      1. Go to Admin/Content/Wiki/Add Wiki. Save.
      2. Next to the newly created wiki node click Actions/Import Pages.
      3. Provide attached test2.xml as the Pages File, and testfiles2.zip as the Images File.
      4. Enable "Import only the latest version and not the full history." and "Strict Mode". Click Import.

      Testing:
      6.2.x: Reproduced 30e56b396c4ae2138dbff0861d648bf04ab0e473
      Master: Reproduced 5908bb6e09d4cf34cd72e40c5ad834746e4151bc
      Result: Tomcat console throws error:

      10:55:10,959 ERROR [BufferedIncreament-DLFolderLocalService.updateLastPostDate(long,Date)-2][BufferedIncrementRunnable:68] Unable to write buffered increment value to the database
      com.liferay.portlet.documentlibrary.NoSuchFolderException: No DLFolder exists with the primary key 21060
      	at com.liferay.portlet.documentlibrary.service.persistence.DLFolderPersistenceImpl.findByPrimaryKey(DLFolderPersistenceImpl.java:10048)
      	at com.liferay.portlet.documentlibrary.service.persistence.DLFolderPersistenceImpl.findByPrimaryKey(DLFolderPersistenceImpl.java:10066)
      	at com.liferay.portlet.documentlibrary.service.impl.DLFolderLocalServiceImpl.updateLastPostDate(DLFolderLocalServiceImpl.java:1093)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115)
      	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62)
      	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51)
      	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111)
      	at com.liferay.portal.increment.BufferedIncreasableEntry.proceed(BufferedIncreasableEntry.java:48)
      	at com.liferay.portal.increment.BufferedIncrementRunnable.run(BufferedIncrementRunnable.java:65)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:744)

      And if you view the pages on import, the links show as broken, and in the browser console, it also throws errors.

        Attachments

        1. fixed.png
          fixed.png
          319 kB
        2. reproduced.png
          reproduced.png
          63 kB
        3. test2.xml
          2 kB
        4. testfiles2.zip
          40 kB

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  4 years, 22 weeks, 3 days ago

                  Packages

                  Version Package
                  6.2.X EE
                  7.0.0 Alpha 2