Missing 'pm' column when adding web site from examples/

Discussion in 'Developers' Forum' started by Richard Foley, Sep 23, 2019.

  1. Richard Foley

    Richard Foley Member

    am working on getting a website installed via the remote API. Using the examples in
    Code:
    sites_web_domain_add.php
    I came across the following error:
    Code:
    Data truncated for column 'pm' at row 1 INSERT INTO `web_domain` (...
    Now the value was
    Code:
    ''
    This confused me until I realised the column wasn't even sent. The defaults were taken from the examples/ directory, so the missing column was being generated from the database defaults, which did of course not exist, and it's an ENUM. Just FYI, maybe something to fix?
     
  2. mikosf

    mikosf New Member HowtoForge Supporter

    in case someone stumbled across this while searching for the same error.
    i encountered this while adding cwispy/ispcfg3 module to WHMCS
    was unable to add website from the client panel of ispcfg3 model tools
    had to comment out pm field in web_vhost_domain.tform.php
    Thank you Richard for pointing out the source of the issue
     
  3. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    @mikosf, the correct fix is to add a 'pm' field to your api call; that needs done for the example sites_web_domain_add.php file. By commenting that out in your form definition, you will not be able to change that in the gui (I don't know if it will produce an error for the unknown field or simply use the sql default, 'ondemand').
     
    ahrasis likes this.
  4. mikosf

    mikosf New Member HowtoForge Supporter

    @jesse, your absolutely right, and will be done when migrating to production, i am not a developer so had to find the logic on this to test some functionalities
    And yes, the 'pm' field has a default this is why it worked
    Thank you
     
  5. mikosf

    mikosf New Member HowtoForge Supporter

    Issue fixed by setting sql to strict mode
    sql_mode=NO_ENGINE_SUBSTITUTION
    Seems i have missed this step somewhere along the way while setting up ISPconfig
     

Share This Page