Viewing 5 replies - 1 through 5 (of 5 total)
  • Yflement,

    I think I’m seeing the same problem. Can you explain where this change needs to be made? In the meantime I’ll be poking through the plugin files looking for it…

    Thanks!

    Thread Starter yflement

    (@yflement)

    Hello mbcoulter,

    It’s in: import-html-pages/html-importer.php
    In the function: fix_internal_links
    On line: 139

    After I made this change, it correctly detected the internal links, so hopefully it works for you as well!

    Thanks for that! I have the internal links working upon import, but have a similar problem with failed file imports. Here’s an example of the path that gets reported in error:

    Could not find the right path to… tried…

    C:/fakepath/webroot/socioecon/topics/long-file-name-(2006).xlsx

    I find in every instance the failed path lacks the final folder in the URL. In this example it is “/population/”. And this is the folder where the parent “index.html” page is that links to the PDFs.

    So the real path that would work (and contains the PDFs and parent index) is this
    C:/fakepath/webroot/socioecon/topics/population/long-file-name-(2006).xlsx

    Parsing the regex in the plugin ain’t my strong point!

    BTW – the import of images works fine…

    Thread Starter yflement

    (@yflement)

    I’m afraid I won’t be able to help with that as I have basically no knowledge of PHP and I also didn’t have to import files or images.

    However I did use this tool:

    https://regex101.com/

    to test the regex. Perhaps it can be of some use for you…

    Chris

    (@wabarch-chris)

    I had the same problem with files that are linked like this: <a href="foo.pdf">Foo PDF</a> not being imported — the code looks for ../foo.pdf and since I couldn’t track down the bug that caused this I simply copied every attachment into it’s parent directory before running the import to work around this issue.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Internal links regex broken’ is closed to new replies.