Okay
  Public Ticket #1594263
Bug: Wrong value of field with foreign key when editing other field
Closed

Comments

  • xaverlalo started the conversation

    Hello,

    I use the latest Version and have the following Problem.

    Given there is a table_b with two columns (column_a string; column_b string with foreign key relation to table_a, display value: name, store value: id)

    And there is a row with values test, 1 correctly shown as test, name_from_table_a

    When I edit this row and change test to test2

    And don't touch value from column_b

    And save this

    Then 
    the row is stored with values test, name_from_table_a but should be test, 1

    HINT:

    <select id="table_3_columnb" data-input_type="selectbox" data-key="columnb" class="form-control editDialogInput selectpicker wdt-possible-values-ajax wdt-foreign-key-select" data-live-search="true" data-live-search-placeholder="Search..." data-column_header="column_b" tabindex="-98">
        <optgroup label="Currently Selected">
            <option value="name_from_table_a" title="name_from_table_a" selected="selected">name_from_table_a</option>
        </optgroup>
        <option value="" title=""></option>
        <option value="1" title="name_from_table_a">name_from_table_a</option>
    </select>
    THE ERROR value="name_from_table_a" of element //*[@id="table_3_columnb"]//option[@selected="selected"]
  •   xaverlalo replied privately
  •  387
    Bogdan replied

    HI xaverlalo,
    Thank you for your purchase.

    Please provide me a temporary WP-admin login for your site where this happens, so we could log in and take a look ‘from the inside’ as that’s the most efficient way to see and resolve the issue. We do not interfere with any data or anything else except for the plugin (in case that’s a production version of the site), and of course we do not provide login data to third party. You can write credentials here just check Private Reply so nobody can see them except us.

    Best regards.

    Check out our newest product - Amelia - Enterprise-Level WordPress Appointment Booking Plugin - promo price for launch period!

    Kind Regards,
    Bogdan Radusinovic
    bogdan@touchmesoft.net

  •  1
    Chase Sabers replied

    Hello, We are running into this same issue. Instead of the foreign key being entered it enters the string. So editing one cell breaks the rest, then this also does not allow for any filters to work. Please help as our main table is basically all built out on foreign keys.

  •  387
    Bogdan replied

    HI Chase,

    Can you please open a new ticket where you will be the owner and one of our agents will help you.

    Best regards.

    Check out our newest product - Amelia - Enterprise-Level WordPress Appointment Booking Plugin - promo price for launch period!

    Kind Regards,
    Bogdan Radusinovic
    bogdan@touchmesoft.net

  •   xaverlalo replied privately
  •   Bogdan replied privately
  •   xaverlalo replied privately
  •  1
    Chase Sabers replied

    Not sure where you guys are in the progress of this, but I think to have fixed why this wasn't working for us. We had the column with foreign keys with the data to view set to the default of 10. When our actual list had more than 10, once we changed to all it seemed to start saving correctly. We also had a checkbox filter on but took that off.

  •  387
    Bogdan replied

    Hi Chese,

    There was a small issue with default values list.

    Maybe this can help you out.

    In file wp-content/plugins/wpdatatables/controllers/wdt_ajax_actions.php

    And after the last line of code add this line 

    add_action('wp_ajax_nopriv_wpdatatables_get_column_possible_values', 'wdtGetColumnPossibleValues');

    so it will look like this (attachment )

    Best regards.

    Attached files:  Screen Shot 2018-06-04 at 11.31.42 AM.png

    Check out our newest product - Amelia - Enterprise-Level WordPress Appointment Booking Plugin - promo price for launch period!

    Kind Regards,
    Bogdan Radusinovic
    bogdan@touchmesoft.net

  •  1
    Chase Sabers replied

    Bogdan,
    I apologize, as I didn't open this ticket but is that solution for anyone whom is having the issue or just the person whom opened this ticket?

    Thanks,

    Chase

  •  387
    Bogdan replied

    Hi Chese,

    This code should be applied to all users until we include it for our next update of the plugin.

    Best regards.

    Check out our newest product - Amelia - Enterprise-Level WordPress Appointment Booking Plugin - promo price for launch period!

    Kind Regards,
    Bogdan Radusinovic
    bogdan@touchmesoft.net

  •  1
    Chase Sabers replied

    Great, thank you for your assistance on this matter and finding a solution. You've been great with support.

  •   Bogdan replied privately
  • xaverlalo replied

    Hi Bogdan,

    sadly your fix does not solve my problem.

    I created a video showing the bug. Have a look at the attachment please.

    Attached files:  bug.mkv

  •  387
    Bogdan replied

    Hi xaverlalo,

    Ok i can see now the issue.

    Can you please revert back the credentials so I can take a look at your site again.

    Best regards.

    Check out our newest product - Amelia - Enterprise-Level WordPress Appointment Booking Plugin - promo price for launch period!

    Kind Regards,
    Bogdan Radusinovic
    bogdan@touchmesoft.net

  •   xaverlalo replied privately
  •   Bogdan replied privately
  •   xaverlalo replied privately
  •   Milan replied privately
  • xaverlalo replied

    I don't think you are able to solve this. It's definitely a bug! I don't have the time to write here again and again. I wrote a litte plugin by myself for my use case and now i simply avoid the foreign key functionality.

    The example you have created uses the workaround that was proposed by Chase Sabers. By the way I have expressly forbidden you to change or access any data on MY system exept from tables with IDs 8, 9 and 10! Use your own system for testing, please!

    You may close this ticket. I'm really pissed about not reading the information I've provided in this ticket and violating the rules about data access on my system. 

  •  175
    Milan replied

    HI xaverlalo,

    We can feel your frustration and of course it is not in our interest to get our users frustrated. I apologize for my actions on your website, but I just what to help you out by trying to figure out what steps did you take when you made a table and try to reproduce the issue.

    We did't see it from tables that you made because it is already saved in database in wrong format. It is nothing changed  in your tables, we just made new ones to try reproduce the issue. We can't reproduce the issue because column that we used for foreign key was made with Integer column type. 

    After testing in our local environment we reproduce the issue. When you are make table and set for column that you want to use for foreign keys to string and if is option  Number of possible values to load set not set to ALL.  I can confirm now that this is the bug on our side and thank you very much for reporting it.  I forwarded this to my team and it will be fixed for the next update. My suggestion for now is to make first column as integer or if you made column with column type string to set option Number of possible values to load to ALL .

    Thank you very much for reporting this and sorry for any inconvenience. 

    Best regards.

    Check out our newest product - Amelia - Enterprise-Level WordPress Appointment Booking Plugin - promo price for launch period!

    Kind Regards,
    MIlan Jovanovic
    milan.jovanovic@touchmesoft.net