We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1778
    • 659 Posts
    Hi all

    I do my first steps in developing my 3PC, and all goes fine using the excellent modExtra as starting point.

    However I have noticed this strange behaviour and don’t understand why it happens...

    My table schema (simplified) is like that:
    <model package="cispeo" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" phpdoc-package="cispeo">
        <object class="cpoCompany" table="cispeo_companies" extends="xPDOSimpleObject">
            
    		<field key="name" dbtype="varchar" precision="80" phptype="string" null="false" default="" index="index" />
    		<field key="office" dbtype="varchar" precision="80" phptype="string" null="true" default="" index="index" />
    		<field key="description" dbtype="text" phptype="text" null="true" default="" />
    		<field key="address1" dbtype="varchar" precision="255" phptype="string" null="true" default="" />
    		<field key="address2" dbtype="varchar" precision="255" phptype="string" null="true" default="" />
    		<field key="address3" dbtype="varchar" precision="255" phptype="string" null="true" default="" />
    		<field key="zipcode" dbtype="varchar" precision="10" phptype="string" null="true" default="" index="index" />
    		<field key="city" dbtype="varchar" precision="100" phptype="string" null="false" default="" index="index" />
    		<field key="country" dbtype="varchar" precision="100" phptype="string" null="false" default="" />
    		<field key="phone1" dbtype="varchar" precision="20" phptype="string" null="true" default="" />
    		<field key="phone2" dbtype="varchar" precision="20" phptype="string" null="true" default="" />
    		<field key="email" dbtype="varchar" precision="255" phptype="string" null="true" default="" />
    		<field key="website" dbtype="varchar" precision="255" phptype="string" null="true" default="" />
    
        </object>
    
    </model>


    As you see I have 3 fields for the address named respectively "address1", "address2", "address3", and 2 fields for the phone named "phone1" and "phone2", all with the same stucture...

    Now when I create or update a record what happens is the following :

    Fill in the 3 "address" fields... :
    - "address1" is not saved
    -"address2" is saved
    -"address3" is saved but in the "address1" field !

    Fill in the phones field --> only "phone2" is saved...

    This behavior happens only when my fields are named "something1" "something2" etc... Not happens with other fields (with no number in their names)

    Am I doing something wrong ? Are the numbers in a field name prohibited ? Have I to rename the fields without numbers ? with underscores between text and number ?

    Thanks for your help
    Cheers


    [EDIT & SOLVED] : Sorry ’bout this, not enough sleep and not enough coffee I guess, the problem was in my ’update window’, I probably did a too fast copy/paste and had two fields with name "address1"... pfffffff !