We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3749
    • 24,544 Posts
    Definitely. It should be available here: http://github.com/BobRay in the xpdoGenerator pull request.

    While you’re there, you could vote for the pull request. wink

    If you can’t get it that way, let me know and I’ll post it.

      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
      • 4172
      • 5,888 Posts
      thanks Bob, this works great!
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 3749
        • 24,544 Posts
        Quote from: Bruno17 at Oct 28, 2010, 02:40 PM

        thanks Bob, this works great!
        Glad to hear it. I’m looking forward to seeing your CMP.

        BTW, the only advantage to the mod is that it lets you specify the class name for each table and lets you process tables with the same prefix as the MODx tables (which probably shouldn’t be done in the first place).

        Bob
          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
          • 4172
          • 5,888 Posts
          Quote from: BobRay at Oct 28, 2010, 08:19 PM

          Quote from: Bruno17 at Oct 28, 2010, 02:40 PM

          thanks Bob, this works great!
          Glad to hear it. I’m looking forward to seeing your CMP.

          BTW, the only advantage to the mod is that it lets you specify the class name for each table and lets you process tables with the same prefix as the MODx tables (which probably shouldn’t be done in the first place).

          Bob


          you can see it here:
          http://github.com/Bruno17/xdbedit
          instructions:
          http://github.com/Bruno17/xdbedit/wiki
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 4172
            • 5,888 Posts
            fixed a bug with ’_’ in tablename.
            It uses now
            $manager= $modx->getManager();
            $generator= $manager->getGenerator();
            $classname = $generator->getClassName($tablename);

            to get the correct classname

              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 10355
              • 44 Posts


              Fatal error: Call to a member function set() on a non-object in J:\home\revo\www\core\cache\elements\modsnippet\19.include.cache.php on line 36

              file 19.include.cache.php
              if (empty($dataobject)){
                  $dataobject = $modx->newObject($classname);
                  //$dataobject->set(\'createdby\', $modx->user->get(\'id\'));
              }
              else{
                  //$dataobject->set(\'editedby\', $modx->user->get(\'id\'));
              }
              $allFormFields = $hook->getValues();    
              foreach ($allFormFields as $field=>$value){
                  
                  if ($field !== \'spam\' && $field !== \'resource_id\'){
                      $dataobject->set($field,$value);
                  }       <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< line 36 <<<<<<<<<<<<
              }
              
              $dataobject->save();
              
              return true;
              }
              ';
              What could be the problem?
                • 4172
                • 5,888 Posts
                seems $dataobject isn’t a xpdo-object at this time.
                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!
                  • 3749
                  • 24,544 Posts
                  This line is failing:

                  $dataobject = $modx->newObject($classname);


                  You should have a sanity check after it:


                  <?php
                  if (!is_object($dataobject) || !($dataobject instanceof xPDOObject)) {
                       die('Failed to create object of type: ' . $classname);
                  }

                    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
                    • 10355
                    • 44 Posts
                    Bruno17 Please explain in more detail
                    your snippet formit2db creates a table?

                    I’m by your example creates two snippets db2formit and formit2db,
                    created a resource formit-snippetcall, comes with Pocket schema and classes,
                    but when I enter data into a form I have nothing happens (form is only updated) table "modx_regatta_ausschreibung" not in my database.

                    What am I doing wrong?

                    I strongly need a formit create documents in my data table with some fields.
                      • 4172
                      • 5,888 Posts
                      ok, we do it in small steps, because I haven’t much time at the moment, sorry.

                      1. step:

                      create your table and tell us the name and perhaps the structure of your table.
                        -------------------------------

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!