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

    I’m working my way through the tutorial http://rtfm.modx.com/display/revolution20/Developing+an+Extra+in+MODX+Revolution

    I have got to the "Building the Query" section and have come unstuck as I don’t have a "modx_doodles" table in my database.

    Firstly, am I suppose to create this DB table manually using phpMyadmin or should MODx create the DB table??

    Secondly, if I am suppose to create the DB table manually using phpMyAdmin how do I go about creating the DB table correctly based on the xml schema?

    Any assistance on this would be awesome.

    Regards,

    Jezz.

      • 4172
      • 5,888 Posts
      When your xml-schema is created correctly and on its place, xpdo will create the table for you, the first time you try to use that table per xpdo.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 11055 ☆ A M B ☆
        • 3,112 Posts
        Quote from: Bruno17 at Mar 06, 2011, 04:46 AM

        When your xml-schema is created correctly and on its place, xpdo will create the table for you, the first time you try to use that table per xpdo.
        If it uses getCollection.
        If it calls newQuery, it won’t.
          Rico
          Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
          MODx is great, but knowing how to use it well makes it perfect!

          www.virtudraft.com

          Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets

          Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

          Maintainter/contributor of Babel

          Because it's hard to follow all topics on the forum, PING ME ON TWITTER @_goldsky if you need my help.
          • 4172
          • 5,888 Posts
          Right. Or getObject(),newObject()........
          the first time you try to use that table per xpdo

          with newQuery() alone you don’t use that table wink
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 22019
            • 390 Posts
            Jezz - you could also try installing the Doodles package under ’Package Management’ first.
              Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
              • 14075
              • 2 Posts
              Ah hah ... Thank you all for your responses, you put me on the right track to fixing my problem.

              So to recap, as you all explained by using getCollection along with the correct XML Schema MODx should create the database table for you provided your code is correct.

              So there must be an issue with my coding. After reviewing it all I found the issue.

              In the "The Include Snippet" part of the tutorial it required me to create a "Doodles" resource with the following content

              [[!include? &file=`[[++doodles.core_path]]elements/snippets/snippet.doodles.php`]]


              This I did. However the resource I created had been using the TinyMCE editor to manage the content of the resource which messed with this line of code.

              After disabling the editor and fixing the line of code everything worked fine and MODx successfully created the database.

              Again, thank you for help and getting me pointed in the right direction.

              Regards,

              Jezz.