We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 47949
    • 5 Posts
    Howdy,

    I doubt that the last issue I posted (http://forums.modx.com/thread/91418/short-tags-articles-and-page-nav-not-working) is related, but...you never know.

    The WordPress import tool is adding posts from the XML twice for me. From looking at the articles' IDs, it appears that the import tool is parsing the file a second time around.

    thanks,
    --Chris Baker
      • 3749
      • 24,544 Posts
      Assuming that you didn't run the import twice . . . did you look in the modx_site_content table in the DB to see if they're really in there twice? (and in the import file to make there they're not in there twice).
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 47949
        • 5 Posts
        Yes, Bob! Thanks for asking.

        I pretty much checked the obvious possibilities before I posted. When I do a Find on the XML file, there is only one result for one of the Article titles. But, phpMyAdmin shows double the records it should for WHERE `class_key` LIKE 'Article', and it shows two rows for the same Find I did in the XML file. When I compare the rows, they contain the exact same data.

        We're only talking about ~125 Articles, so using Batcher to delete the duplicates isn't terrible, but it would be nice to deliver to the client without too many developer notes ("if you create a new blog by importing, you'll have to delete duplicates") wink

        thanks,
        --Chris Baker
          • 3749
          • 24,544 Posts
          I figured that you had checked, but had to ask since I assume that by now there have been a fair number of WP imports done and no one else has reported that problem.

          It probably wouldn't be too difficult to create a utility snippet to remove the duplicates, but it really shouldn't happen in the first place.

          The code in the articlesimportwordpress.class.php file that does the creation is pretty straightforward:

          foreach ($data->channel->item as $item) {
              $article = $this->createArticle($item);
              if (!empty($article)) {
                  $imported = true;
              }
          }
          


          If you have the time and inclination, you might throw some debugging code into that class file.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting