We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4172
    • 5,888 Posts
    &hooks=`spam,formit2db,email,redirect` 

    sendig a mail is working here?
      -------------------------------

      you can buy me a beer, if you like MIGX

      http://webcmsolutions.de/migx.html

      Thanks!
      • 31677
      • 5 Posts
      Yes, sending mail is working, with this combination.
      • AFAIK,
        to use a snippet in the FormIt’s hook, that snippet should be modified a bit.
        The $scriptProperties belongs to FormIt, not that hook.
          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.
          • 14372
          • 49 Posts
          Hey,

          Added the two snippets and it formed the folders e.t.c. ... but when I try add data, no new records are created ... added this code to the snippet ...

          $allFormFields = $hook->getValues(); 
          $errorMsg = '<pre>'.print_r($allFormFields,true).'</pre>';  
          $hook->addError('error_message',$errorMsg);  


          And I get this ...


          Array
          (
              [nospam] => 
              [fullname] => ZZZZZZ ZZZZZ ZZZZZ
              [email] => [email protected]
              [id] => 32
              [department] => e.g. Core Networks
              [duration] => 3
              [renumeration] => 1
              [apply-method] => 1
              [interns] => 3
              [date] => 15-06-2011
              [postbtn] => Post Position
          )
          


          Details are;

          • FormIt Version 1.6
            MODx 2.1.0-rc4
            Prefix = vw_ah_pos_
            Package = positionpostings
            Table = postings
            In the actual DB = vw_ah_pos_postings
            • 4172
            • 5,888 Posts
            do you get a new record, when you add this two lines?

            $dataobject->set('fullname', 'ZZZZZZ ZZZZZ ZZZZZ');
            $dataobject->save();
            
            $allFormFields = $hook->getValues(); 
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 14372
              • 49 Posts
              I added your lines and got this ...

              Parse error: syntax error, unexpected T_IF in /home/content/48/7895848/html/core/cache/includes/elements/modsnippet/47.include.cache.php on line 27


              By the way, I simply added ... this ...

              $dataobject->set('fullname', 'ZZZZZZ ZZZZZ ZZZZZ');
              $dataobject->save();


              Over the line with this ...

              $allFormFields = $hook->getValues();


              Don’t know if my DB is the problem ... but just as a way of letting you see how the table looks is the following SQL statement (maybe i’ve done something really dumb down there smiley just lemme know)

              CREATE TABLE `vw_ah_pos_postings` (
                `ind` int(10) unsigned NOT NULL auto_increment,
                `id` int(10) unsigned NOT NULL,
                `department` varchar(255) character set latin1 NOT NULL,
                `duration` int(10) unsigned NOT NULL,
                `renumeration` int(1) unsigned NOT NULL,
                `apply-method` int(1) unsigned NOT NULL,
                `interns` int(100) NOT NULL,
                `date` varchar(10) character set latin1 NOT NULL,
                PRIMARY KEY  (`ind`)
              ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
              


              And ... just so you know, I copied the snippet code from the first comment on this post, as is. Lemme know if there’s any other info that might help in debuggin ... + the table is already created + the schema/component folder files.
                • 14372
                • 49 Posts
                Do I have to edit formit to DB anywhere?

                How does formit to DB know what fields I want to send to the DB?
                  • 4385
                  • 372 Posts
                  formit2db stopped working when I upgraded to FormIt 1.7.0, I reverted back to 1.6.0 and it started to work again.

                  Any ideas of what changed? The changes below don’t sound like they were cause a problem.

                  Add ability to have "Frequent Visitors" optgroup in FormItCountryOptions, moving specified countries to the top of the list in an optgroup
                  Add missing property translations for FormItStateOptions snippet
                  Fix small issue with stored values after validation of fields
                  Add FormItStateOptions snippet for easy U.S. state dropdowns
                  Add FormItCountryOptions snippet for easy country dropdowns
                  [#5101] Fix issue with emailMultiSeparator and emailMultiWrapper default values
                  Fix issue with bracketed field names being added as extra fields post-validation with . prefix
                    DropboxUploader -- Upload files to a Dropbox account.
                    DIG -- Dynamic Image Generator
                    gus -- Google URL Shortener
                    makeQR -- Uses google chart api to make QR codes.
                    MODxTweeter -- Update your twitter status on publish.
                    • 30319
                    • 406 Posts
                    Quote from: BobRay at Apr 04, 2011, 11:42 PM

                    Quote from: vishalashah at Apr 04, 2011, 07:26 PM

                    I tried with an empty prefix as well, but get the same message. Is the Prefix required?
                    I’m not sure if it’s required, but you should really have one to distinguish your table(s) from the MODX tables with the modx_ prefix. The _modx prefix is assumed if there’s no prefix.

                    This about custom prefix...I’m not sure here...My modx database uses a custom prefix for all tables -- but not modx_ -- for this formit2db app is it being suggested to use a prefix different than the custom prefix one has already established???

                    Thank you, Tom
                      • 4172
                      • 5,888 Posts
                      you don’t need to use your own prefix, when your schema is allready created. I use own prefixes when I want autocreate the schema from tables. Otherwise writeSchema will create a schema from all tables.

                      Some times ago Bob did a modification to the writeSchema-function for accepting a tablenames-array and made a github-pull-request.
                      But this didn’t make it to any version of xpdo, so far I know.

                      So we still need to use our own prefix, if we want to create a schema only from some tables.
                        -------------------------------

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!