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
    best practice is, never to use special chars, other than underscores, and have everything lowercase in fieldnames.
      -------------------------------

      you can buy me a beer, if you like MIGX

      http://webcmsolutions.de/migx.html

      Thanks!
      • 37143
      • 74 Posts
      Hi everyone, having a similar problem as well. Used migxDB to setup my package (thanks Bruno for the help!), and I can manage it from the CMP fine.
      So now I tried to set up a form for frontend, and hitting same snag.

      Error log says: addPackage called with an invalid package name.
      ...when i load the form on the front end.

      My FormIt call is:

      [[!FormIt?
      &hooks=`spam,formit2db,email,redirect`
      &preHooks=`db2formit`
      &prefix=`crm_`
      &packageName=`leads`
      &tablename=`leads`
      &emailTpl=`EmailChunk`
      &emailTo=`[email protected]`
      &redirectTo=`12`
      &classname=`Leads`
      ]]

      and im pretty sure of the names above.

      <?xml version="1.0" encoding="UTF-8"?>
      <model package="leads" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" version="1.1">>
      <object class="Leads" table="leads" extends="xPDOSimpleObject">
      <field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default="" />

      and my table is named crm_leads

      my form is only passing in 3 fields

      when i submit the form, error log then adds:
      [2016-02-19 12:51:47] (ERROR @ /index.php) Could not load class: Leads from mysql.leads.
      [2016-02-19 12:51:47] (ERROR in FormIt2db Hook @ /index.php) Failed to create object of type: Leads

      Can anyone suggest what I might be doing wrong?
      Thanks!
        • 37143
        • 74 Posts
        to anyone who may be copying/pasting examples (like me), looks like my issue was with the packageName=`something`

        &packageName=`leads`

        needed to be

        &packagename=`leads`
          • 23819
          • 37 Posts
          THANK YOU SO MUCH !! I could have searched for long time without coming across this post.

          Quote from: mintnl at Sep 16, 2015, 08:45 AM
          Maybe an old thread but a had a similar problem in one of my configs.

          Went the migxdb way and have most configs working briliant.
          However 1 was not working. While trying to edit or save a row the errorlog threw the HY093 error.
          After reconfiging for several times i decided to remove the minus character form fieldnames. That seems to solve the problem!

          Do not use fieldnames containing a - (minus)!

          i.e. start-time, when edited to starttime the problem was gone.

          In random_Noob's post i see fieldname manu-year and reg-no. Maybe these cause trouble....

          Hope this helps someone.