• Resolved Paul Thomson

    (@pthomson87)


    Hello Yannick,

    Firstly, congrats on creating this plugin, it’s fantastic.

    I’m having a little trouble when it comes to importing links from a CSV file. When I download the template, add the relevant link information and re-upload the links add correctly but instead of them being in the correct category, all but one (I assume the first link to be imported) are not being imported into the category.

    I think it is a small bug as I’ve tried it with multiple categories.

    So, 99% works apart from this little hiccup. It can be a little annoying to set the category for each link.

    My CSV File if you would like to experiment: http://pastebin.com/PasSbBeu

    UPDATE:

    I’ve also just noticed that a new category was created with the same name as one that already exists and that 2 links were imported into it. Very strange?? Screenshot: http://snag.gy/uuX5L.jpg

    Thanks in advance for any help you could offer,
    Regards,
    Paul

    https://wordpress.org/plugins/link-library/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Yannick Lefebvre

    (@jackdewey)

    Glad to hear you’re enjoying Link Library. I will investigate the import issue this evening and let you know what I find. Thanks for the very detailed explanation of the issue and your csv file sample.

    Plugin Author Yannick Lefebvre

    (@jackdewey)

    Hi Paul, the problem was the & character in the category name. It is stored as an escaped html code in the database and my importer code was not doing the appropriate conversion, so it was not matching.

    I was able to get entries to go into the right category after making a small change, which I just published to the repository. Please update and confirm that it works on your side as well, then mark the issue as resolved.

    Please take the time to rate the plugin too if you can!

    Thread Starter Paul Thomson

    (@pthomson87)

    Hello Yannick,

    Thanks for the quick response and for taking the time to fix the bug.

    To test I created the category ‘test / testing & test – hyphen’ (slug: test-testing-test-hyphen), after editing my import CSV file with the new category name and trying to import the following things happened.

    • A new category was created without a name but with the slug of ‘test-testing-test-hyphen-2’
    • all the links were imported into this category and not the original category

    So I think there is still a problem, maybe not with special characters but when trying to import into a category that already exists. When this happens the plugin seems to try to duplicate the category but randomly doesn’t give it a name.

    I hope this is clear? I have taken another screenshot to further clarify: http://snag.gy/bMCeZ.jpg

    Plugin Author Yannick Lefebvre

    (@jackdewey)

    Seems more like you caught one thing that throws the WordPress content cleanup functions for a loop. The hyphen you used is the large emdash, instead of the short hyphen:

    test / testing & test – hyphen

    vs

    test / testing & test – hyphen

    When I use the latter for the category name, the import function works like a charm, but when I use the larger emdash, it returns null. I will investigate a bit more why this is happening, but for now, try not to use this character in your link categories and you should be fine.

    Plugin Author Yannick Lefebvre

    (@jackdewey)

    Actually, the large dash is throwing off the PHP parser function fgetcsv, and not the WordPress string cleanup functions. Searched a bit for a solution but did not see anything obvious. Again, try to avoid that character and you should be fine. I had multiple successful tests loading data in existing link categories.

    Thread Starter Paul Thomson

    (@pthomson87)

    Good work Yannick, working like a charm! I have not found a solution to the PHP issue either but will let you know if I find something?

    Thanks again for your help and continued support and development on this plugin.

    Regards,
    Paul

    Plugin Author Yannick Lefebvre

    (@jackdewey)

    Closing issue.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Import from CSV – Links imported, categories not’ is closed to new replies.