We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37747
    • 50 Posts
    BUMP! sorry but still getting this error on production environment:

    addPackage called with an invalid package name


    can anybody help?
      • 4172
      • 5,888 Posts
      first thing:

      good practice is to name your packages all lowercase

      second:

      Is your package then created under core/components/dragoncontact ?

      if yes, third:

      what is the resulting xpdo-schema?
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 37747
        • 50 Posts
        Quote from: Bruno17 at Apr 18, 2013, 12:24 PM
        first thing:

        good practice is to name your packages all lowercase

        second:

        Is your package then created under core/components/dragoncontact ?

        if yes, third:

        what is the resulting xpdo-schema?

        I tried with all lowercase package name, didn't make any difference.
        Nothing is created under /core/components/
          • 4172
          • 5,888 Posts
          you have the db2formit - snippet, but no folders are created under core/components/ ?

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

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 37747
            • 50 Posts
            Quote from: Bruno17 at Apr 18, 2013, 05:03 PM
            you have the db2formit - snippet, but no folders are created under core/components/ ?


            Yes, I installed via Package management and my formit call has this in it:

            		&hooks=`spam,formit2db,email`
            		&preHooks=`db2formit`
            		&prefix=`modx_dragon_`
            		&packageName=`dragcontact`
            		&tablename=`contact`
            


            (changed the camelCase)

              • 4172
              • 5,888 Posts
              seems the property 'packagename' is now also all lowercase, in Jako's Version
              https://github.com/Jako/FormIt2db/tree/master/core/components/formit2db/docs
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 4172
                • 5,888 Posts
                I see it doesn't do writeSchema and parseSchema like the version here at the forum.

                with MIGX its possible to do that out of its CMP in the manager.
                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!
                  • 37747
                  • 50 Posts
                  Quote from: Bruno17 at Apr 18, 2013, 05:54 PM
                  I see it doesn't do writeSchema and parseSchema like the version here at the forum.

                  with MIGX its possible to do that out of its CMP in the manager.

                  I try and do it by creating my own snippet then, thanks for the help
                    • 44231
                    • 126 Posts
                    hi there I tried to formit and formit2db from the first post in this thread but when I click save nothing happen so I check my database table if data is added unfortunately only the field id is the only field which is adding the other fields is blank?

                    is there something Im missing??

                    this is my code:

                    [[!FormIt? 
                    &hooks=`spam,formit2db,email` 
                    &preHooks=`db2formit`
                    &prefix=`mod_table_`
                    &packageName=`test2`
                    &tablename=`test`
                    &emailTpl=`myEmailChunk` 
                    &emailTo=`[email protected]`
                    ]]
                    <h2>Registration Form</h2>
                    <p>[[+fi.error.error_message]]</p>
                    <form class="form" action="[[~[[*id]]]]" method="post">
                        <input name="nospam" type="hidden" />
                        <input name="id" type="hidden" value="[[+fi.id]]" />
                        <label for="fname">
                            First Name:
                            <span class="error">[[+fi.error.fname]]</span>
                        </label>
                        <input id="fname" name="fname" type="text" value="[[+fi.firstname]]" />    
                         
                    
                        <label for="lname">
                            Last Name:
                            <span class="error">[[+fi.error.lname]]</span>
                        </label>
                        <input id="lname" name="lname" type="text" value="[[+fi.lastname]]" />
                        
                            <label for="mname">
                            Middle Name:
                            <span class="error">[[+fi.error.mname]]</span>
                        </label>
                        <input id="mname" name="mname" type="text" value="[[+fi.middlename]]" />
                        
                    <br class="clear" />
                    <div class="form-buttons">
                            <input type="submit" value="Save" />
                        </div>
                    </form>


                    thanks in advance!
                      • 45147
                      • 1 Posts
                      if you want to edit table-row add &resId=yourRowID to your URL <- replace yourRowID with id of tablerow

                      im having trouble with working out how this is supposed to work? is row id the primary key in my table? for one table I have a dual key, how would that work?

                      also I cant see any reference to "resId" in the code from package manager, so im guessing from the docs im supposed to use the "where" clause? I cant seem to get this correct either, here is my formit call

                      [[!FormIt? 
                      &hooks=`spam,formit2db,email` 
                      &preHooks=`db2formit`
                      &prefix=`user_`
                      &packagename=`test`
                      &tablename=`test`
                      &classname=`test`
                      &where='{"user_id":12}'
                      ]]


                      but it doesnt do what i am hoping...... I was hoping that if a value was specified then it would grab that row from my db and fill the fields (provided i use the fi.fieldname type bits).... will paste my whole resource in, incase anyone can see what it is im doing wrong, but im really stumped with this!

                      [[!FormIt? 
                      &hooks=`spam,formit2db,email` 
                      &preHooks=`db2formit`
                      &prefix=`user_`
                      &packagename=`test`
                      &tablename=`test`
                      &classname=`test`
                      &where='{"user_id":12}'
                      ]]
                       
                      <h2>Resource Form</h2>
                      [[+fi.id]]
                      <p>[[+fi.error.error_message]]</p>
                      <form class="form" action="[[~[[*id]]]]" method="post">
                      <input name="resource_id" type="hidden" value="[[+fi.id]]" />
                          <input name="nospam" type="hidden" />
                          <label for="user_id">
                              user_id:
                              <span class="error">[[+fi.error.user_id]]</span>
                          </label>
                          <input id="user_id" name="user_id" type="number" value="[[+fi.user_id]]" />    
                           
                       
                          <label for="address">
                              address:
                              <span class="error">[[+fi.error.address]]</span>
                          </label>
                          <input id="address" name="address" type="text" value="[[+fi.address]]" />
                      <br class="clear" />
                      <div class="form-buttons">
                              <input type="submit" value="Save" />
                          </div>
                      </form>
                      [ed. note: stowelly last edited this post 10 years, 6 months ago.]