Results 1 to 10 of 10

Thread: Custom Field Issue still lingering

  1. #1
    rengstrom is offline Member
    Join Date
    May 2005
    Posts
    7

    Default Custom Field Issue still lingering

    So I wiped my 3.0b install and installed 3.0c (in hopes it would fix my problems). It didn't help. I ran through the 3.0 user guide, and the "custom field" section was nice and simple, but it doesn't work. I'm at a loss and I was so hopeful that this system would be useful for my company, but I'm starting to think I'm missing something. So real quick, here is what I did, please, anyone who can help me figure out what the problem is, I would appreciate it!

    I need to add some custom fields to the Users Module. So I logged in as the Admin, went into the Admin, selected Edit Custom Fields, and selected the Users Module from the Drop Down. I added 3 fields. Race, Religion and Test. So now I have 3 fields that list out like this:

    Field Name Field Label Data Type Max Size
    Race_c Race_C Varchar 30
    Religion_c Religion_C Varchar 20

    So next I went into the Field Layout Editor, selected the Users/EditView.html, DetailView.html and ListView.html and dragged the fields to some spare spots. Saved the files and the labels and the text boxes all showed up, on all the pages. Now the problem starts. When I create a new user, edit a previous user, anything, if I add data to any of those fields, it doesn't show up and isn't saved. If I go into the database and select * from users_cstm; there is nothing in there either. If I check the Users table, all the user data is there, but not the custom fields (as they should be in the users_cstm table.

    The rest of the data I tried setting them as required and optional, neither made a difference. I also tried giving them default values, still nothing.

    I'm at a loss.. I can't figure out why I can add leads, opportunities, users, employees, etc.. but I cant get the thing to save custom field data.

    What's slightly more interesting, is that if I look in /var/lib/mysql in the directory for the database I'm using, I can see the users_cstm.MYI, MYD and frm files. the .frm file shows some data in it (default values I had tried to assign to some fields)

    I'm at a loss now. Any help to figure out what I did wrong, or if this is simply some limitation to the system, or a bug, or incompatability with Fedora Core 3.

    Just an addition: I ran the mysqlbinlog on the mysql log file to try and find errors, I found that data re: these fields is being stored in fields_meta_data in the CMR database. I don't know what or why it's there, but it is writing some of the information to the database (at least the Custom Field specifics).

    Thanks
    Last edited by rengstrom; 2005-05-24 at 12:04 AM. Reason: more information to add.

  2. #2
    jonmach is offline Member
    Join Date
    May 2005
    Posts
    5

    Cool Re: Custom Field Issue still lingering

    >Field Name Field Label Data Type Max Size
    >Race_c Race_C Varchar 30
    >Religion_c Religion_C Varchar 20
    >
    >So next I went into the Field Layout Editor, selected the Users/EditView.html, DetailView.html and ListView.html
    >and dragged the fields to some spare spots. Saved the files and the labels and the text boxes all showed up,
    >on all the pages. Now the problem starts. When I create a new user, edit a previous user, anything, if I add data
    >to any of those fields, it doesn't show up and isn't saved. If I go into the database and select * from users_cstm;
    >there is nothing in there either. If I check the Users table, all the user data is there, but not the custom fields
    >(as they should be in the users_cstm table.

    I think the problem comes from the HTML that is created when the custom fields are created.

    If you look at your EditView.html file. You should see the custom field surrounded by quotes (e.g. value="'{RACE_C}'". You might also see type = "'text'". This completely wrong. If you get rid of the single quotes, you should find that this now works.

    Basic problem with the code.

    Any idea how this can be fixed automatically, without having to hand-code the fixes?

    Jon

  3. #3
    rengstrom is offline Member
    Join Date
    May 2005
    Posts
    7

    Default Re: Custom Field Issue still lingering

    Unfortunately, this didnt resolve the problem. I checked the HTML and you are correct, the type='text' had single quotes, which I replace with quotes. So I now have this:
    <td class="dataLabel"><slot>{MOD.Race_c}</slot></td>
    <td class="dataField"><slot><input type="text" name='Race_c' id='Race_c' size='20' maxlength='20' value='{RACE_C}'></slot></td>

    For the value='{RACE_C}' every value= in this form has single quotes, regardless I tried to change it to double quotes, and still nothing. My users_cstm table is still empty.

    Also, the custom fields are the only ones that I noticed that had id='' in the string. I tried putting that in quotes, and removing it all together.. nothing.

    I tried creating a new user, after making these html changes, just to confirm that it wasnt an issue with previously entered users vs. new entries. Sitll no luck. I'm at a loss now.

    Thanks

  4. #4
    rengstrom is offline Member
    Join Date
    May 2005
    Posts
    7

    Default Re: Custom Field Issue still lingering

    This is a bit longer and more data. I jsut tried to edit and save, and I added data to the Race and Religion fields. The output here is from the MySQL logging. I don't even see this attempting to INSERT for those fields?

    #050524 12:52:40 server id 1 log_pos 313445 Query thread_id=101 exec_time=0 error_code=0
    SET TIMESTAMP=1116953560;
    Update users set user_name='rrrr', user_password='', user_hash='', first_name='sa', last_name='rrr', description='', date_entered='2005-05-23 17:37:00', date_modified='2005-05-24 12:52:40', modified_user_id='1', created_by='1', title='', department='', is_admin='off', phone_home='', phone_mobile='', phone_work='', phone_other='', phone_fax='', email1='', email2='', address_street='', address_city='', address_state='', address_postalcode='', address_country='', reports_to_id='', portal_only='0', status='Active', receive_notifications='1', employee_status='Active', messenger_id='', messenger_type='MSN' WHERE ID = '96fd747a-751a-b232-7f9e-42924dab5e53';
    # at 314142

    #050524 12:52:40 server id 1 log_pos 314142 Query thread_id=101 exec_time=0 error_code=0
    SET TIMESTAMP=1116953560;
    UPDATE users SET user_preferences='YToxNzp7czo4OiJncmlkbGluZSI7czoz OiJvZmYiO3M6ODoibWF4X3RhYnMiO3M6MjoiMTIiO3M6MTI6Im Rpc3BsYXlfdGFicyI7YToxNjp7aTowO3M6NDoiSG9tZSI7aTox O3M6NzoiaUZyYW1lcyI7aToyO3M6ODoiQ2FsZW5kYXIiO2k6Mz tzOjEwOiJBY3Rpdml0aWVzIjtpOjQ7czo4OiJDb250YWN0cyI7 aTo1O3M6ODoiQWNjb3VudHMiO2k6NjtzOjU6IkxlYWRzIjtpOj c7czoxMzoiT3Bwb3J0dW5pdGllcyI7aTo4O3M6NToiQ2FzZXMi O2k6OTtzOjQ6IkJ1Z3MiO2k6MTA7czo5OiJEb2N1bWVudHMiO2 k6MTE7czo2OiJFbWFpbHMiO2k6MTI7czo5OiJDYW1wYWlnbnMi O2k6MTM7czo3OiJQcm9qZWN0IjtpOjE0O3M6NToiRmVlZHMiO2 k6MTU7czo5OiJEYXNoYm9hcmQiO31zOjU6InRpbWVmIjtzOjM6 Ikg6aSI7czo4OiJjdXJyZW5jeSI7czozOiItOTkiO3M6NToiZG F0ZWYiO3M6NToiWS1tLWQiO3M6NToidGltZXoiO3M6MToiMCI7 czoxMzoibWFpbF9mcm9tbmFtZSI7czo2OiJ3ZXJ3ZXIiO3M6MT Y6Im1haWxfZnJvbWFkZHJlc3MiO3M6NToiZXJ3cmUiO3M6MTM6 Im1haWxfc2VuZHR5cGUiO3M6ODoic2VuZG1haWwiO3M6MTU6Im 1haWxfc210cHNlcnZlciI7czoxMToiMTAuMTAuMTAuMTAiO3M6 MTM6Im1haWxfc210cHBvcnQiO3M6MjoiMjUiO3M6MTM6Im1haW xfc210cHVzZXIiO3M6NDoid3d3dyI7czoxMzoibWFpbF9zbXRw cGFzcyI7czo0OiJ3d3d3IjtzOjE3OiJtYWlsX3NtdHBhdXRoX3 JlcSI7czowOiIiO3M6MTY6Im1haWxfcG9wYXV0aF9yZXEiO3M6 MDoiIjtzOjIwOiJjYWxlbmRhcl9wdWJsaXNoX2tleSI7czowOi IiO30=' where id='96fd747a-751a-b232-7f9e-42924dab5e53';
    # at 315354

    #050524 12:52:41 server id 1 log_pos 315354 Query thread_id=101 exec_time=0 error_code=0
    SET TIMESTAMP=1116953561;
    DELETE from tracker WHERE user_id='1' and item_id='96fd747a-751a-b232-7f9e-42924dab5e53';
    # at 315482

    #050524 12:52:41 server id 1 log_pos 315482 Intvar
    SET INSERT_ID=32;
    # at 315510

    #050524 12:52:41 server id 1 log_pos 315510 Query thread_id=101 exec_time=0 error_code=0
    SET TIMESTAMP=1116953561;
    INSERT into tracker ( user_id, module_name, item_id, item_summary) values ('1', 'Users', '96fd747a-751a-b232-7f9e-42924dab5e53', 'sa rrr');

  5. #5
    jonmach is offline Member
    Join Date
    May 2005
    Posts
    5

    Red face Re: Custom Field Issue still lingering

    >Unfortunately, this didnt resolve the problem. I checked the HTML and you are correct, the type='text'
    >had single quotes, which I replace with quotes. So I now have this:
    > <td class="dataLabel"><slot>{MOD.Race_c}</slot></td>
    > <td class="dataField"><slot><input type="text" name='Race_c' id='Race_c' size='20' maxlength='20'
    > value='{RACE_C}'></slot></td>

    >For the value='{RACE_C}' every value= in this form has single quotes, regardless I tried to
    >change it to double quotes, and still nothing. My users_cstm table is still empty.

    I've explained it badly. You should see single quotes embedded *within* double quotes. i.e. " '{RACE_C}' ". This means that PHP won't read the variables properly, and will explain why it doesn't appear on the screen. For text custom values, you will also have a default value of '' in the field.

    This is what I had in my HTML code. In effect, this meant the variable was '{RACE_C}' instead of {RACE_C}.

    If you're only seeing on set of quotes, then you may have a different problem. But I'm not convinced as it sounds similar.

    Jon

  6. #6
    norazmi is offline Junior Member
    Join Date
    May 2005
    Posts
    2

    Question Re: Custom Field Issue still lingering

    Hai ... I was reading your stuff. I tried to do the same thing based on my 3.0c installation ... it works but the same problem still ingering when I tried to do the same thing within the Emails and Documents Module.

  7. #7
    rengstrom is offline Member
    Join Date
    May 2005
    Posts
    7

    Default Re: Custom Field Issue still lingering

    Well I quadruple checked my HTML to confirm that there weren't " within ', etc. Everything is right (I even downloaded the files and opened them in a syntax highliting editor to confirm the php and html looked proper. Ive tested everything now, changing the quotes from ' to " and reverse. It's simply not capturing this data. I know it's open source, and there is little support for it, but if one of the devs sees this and has a second to advise, that would be great!

    I also wonder, if I were to pay for the commercial version, would I run into the same problems? The demo system doesn't allow admin access so I can't even test it.

    Again, I appreciate all the feedback and help so far.

    Thanks

    -------------
    Rob Engstrom
    CTO
    Finest Capital, ltd
    www.finestcapital.com

  8. #8
    norazmi is offline Junior Member
    Join Date
    May 2005
    Posts
    2

    Default Re: Custom Field Issue still lingering

    Mie ... again. I mentioned about my problem related to the custom field yesterday. Today I managed to solve mine by changing the code assignment in both Documents & Emails modules. The code is from the Save.php program. I changed it from ....

    $focus = new Email(); to $focus =& new Email();

    $Document = new Document(); to $Document =& new Document();

    It seems to work for me but I'm yet to find out the rest of the side effect or it really work.

  9. #9
    rengstrom is offline Member
    Join Date
    May 2005
    Posts
    7

    Default Re: Custom Field Issue still lingering

    WHOA! That solved the problem. It now saves the data properly! I can't thank you enough for helping me resolve this. I'll continue to mess around with this and see if there are any side effects to making this change (however I suspect that there shouldn't be, given the function of this file in relation to the module).

    It's funny too because I was dissecting this file, trying to figure out if it wasn't capturing the data for input. Guess it wasn't

    Thanks again

  10. #10
    jasmine is offline Junior Member
    Join Date
    Jun 2005
    Posts
    1

    Default Re: Custom Field Issue still lingering

    Hi there,

    I tried to change the code in save.php

    from $Document = new Document(); to $Document =& new Document();

    But i still couldn't save the custom field data.

    Is there other coding that I should change besides the $Document =& new Document();

    Thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •