Okay
  Public Ticket #3613149
error:Column 'pos' cannot be null
Open

Comments

  • fei started the conversation

    This is a question and report about the table made in "Create a data table by importing data from a data source."

    After updating to Ver 6.2.1, the error "Column 'pos' cannot be null" appeared when updating CSV with "Replace rows with source data" as usual.
    After that, the screen looks like the attached URL and the table cannot be accessed.
    The table is now rebuilt to make sure it can be updated successfully.

    I am afraid to update it because there are many similar tables.

    Questions and reports on this
    ・How can I update successfully?
    ・Are you telling users to rebuild?
    ・In the updated table, four items such as "wdt _ created _ by" are automatically added to the column list. Is this the cause?

  •  1,689
    Miloš replied

    Hi fei,

    Sorry for the waiting time.

    We don't work on weekends so it adds two days to the waiting time.

    we appreciate your patience.

    -

    We are not able to reproduce this error when we update our existing Manual Tables with either option, such as adding new rows/ or replacing rows/ or completely replacing source data.

    Would it be possible if you can please record your Screen and send me a Video so that we can see exactly the steps you do;

    and if you can show me how the existing Table looks, then how the CSV looks before you try to update it?

    I advise making a backup of the Table before doing it, since we wish to 'trigger' the error on purpose so that we can help you isolate and debug why it happens;

    and we also wish to try to reproduce it on our end to see if it is a bug.

    It will be best to send it in a Private reply, in case if you show any sensitive data in the Video.

    If it gets too large, you can upload it to weTransfer and send me a download link.



    When you update a Table, the 'premade columns' such as wdt_ID , wdt_created_by, wdt_created_at, wdt_last_edited_by and wdt_last_edited_at, should not be taken into account; 

    in other words, that should not be an issue;

    so when you update it, the CSV should only contain your custom Columns data and that should work.

    But if you can make a new Table from the same CSV - that indicates it maybe has something to do with our new error checking for CSV/Excel/Google Sheet data.

    For example, if you change the Column structure, such as :

    - Change number of columns

    - reorder columns

    - if any of the Columns does not have a header name



    Can you also tell me, when you are updating an existing Manual Table;

    are you excluding the wdt_ID Column from your source CSV?

    You should only have your own custom Columns, and our Manual table will automatically assign each unique auto-increment row ID via the wdt_ID Column.



    Now, we did add new/improved error checking for CSV/Excel/Google Sheet linked Tables.

    Before our new updates, for some users it was working to have some empty Headers, or if they had some Column before but they remove it - and the Spreadsheet has some 'old cache' which rememberes there was some cell without a header before;


    In either case, our developers are making a new fix that can improve this behaviour.

    We have a temporary fix for this issue.

     ( i am not sure if this is the same issue you are having, but you can try it and see if it fixes it)

    Here are the steps how you can apply the Fix.

    Use FTP or your Hosting File Manager, or Plugin File Editor and open this PHP file from our Plugin :

    ..\wp-content\plugins\wpdatatables\source\class.wpdatatable.php.

    Then, around line 3512, use CTRL+F to find this line :

    $headingsArray = $objWorksheet->rangeToArray('A1:' . $highestColumn . '1', null, true, true, true);
    5903367833.png

    Under it, add this :

    while (!end($headingsArray[1])) {
        array_pop($headingsArray[1]);
    };

    So that piece of the code should now look like this :

    1431341441.png

    With a few Excel and CSV files which we got from our users, the fix is working so far, but it is still in the testing stage.



    Let me know if that helps?

    If not, then you are having a different issue. If that is the case, it would be great if you can record your screen as advised, show us how the issue happens;

    And if you can allow us to remotely log in to check the Table setup.

    Please provide me a temporary WP-admin (administrator) user 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 parties. 

    You can write credentials here just check PRIVATE Reply so nobody can see them except us.


    And point us to the Table ID - so we can make a duplicate from it for testing;

    and we can try to reproduce the same issue on our end.

    If you can also send me the CSV file which you use to update the Table;

    so we can try to reproduce it on our end, too.

    Thank you.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • fei replied

    Modifications near line 3512 had no effect.
    I still get error "Column 'pos' cannot be null."

    Sorry, we can't grant site permissions.

    So, I will send you videos in private reply.

  •   fei replied privately
  •   Miloš replied privately
  •   Miloš replied privately
  • fei replied

    Thank you for your kindness.

    As an assumption,
    Version 6.1 or so has no problem updating to CSV.
    Version 6.2.1 update resulted in a titular error.
    The CSV has only increased the data, but the configuration has not changed.
    Not only the CSV table I sent, but all the tables have the same error.
    If you rebuild a new table, you can update it without any problem, but it takes a long time to reset filters and so on.

  • fei replied

    We are sorry but we cannot give you the copy data of the site considering the risk.

    I can't seem to do anything about it, so I'll try to rebuild the table I made in Version 6.1.
    Thank you for reporting to the developer.

  •   Miloš replied privately
  •  1,689
    Miloš replied

    Hi fei,

    First, my sincerest apologies it took us so long to investigate everything about this issue.

    I am sorry to disappoint you, but our developers can confirm it was never possible for our Manual Tables to have  HTML tables 'wrapped' inside our cells.

    So anything wrapped inside HTML table tags like :

    <table>
    ... your table rows and data...
    </table>

    was never possible for the cells inside our Manual ( editable) Tables.

    2280779263.png


    This can only work if you link a Table from a live file, such as CSV/Excel/Google Sheet etc.


    1. For example, if you switch to using a Table linked from a CSV file, then it works, here is a screenshot of how that table would look :

    9790250312.png

    2. But, if you try to import the data from this CSV source to build a Manual Table - this was never possible with our Plugin.

    For our Manual Tables, it is not possible to 'wrap' a HTML table inside our own Table, as mentioned above.


    That is because, for each Manual Table in our Plugin, it creates a new 'stand alone' SQL Table in your Database, which has its own set of columns and rows and with this data structure, it is not possible to have HTML tables inside any cell.


    On the other hand, for linked tables, this kind of data is not saved in the database like manual tables, but instead, their data is stored in the database table wp_wpdatatables_rows in JSON format and that is why it can work for a table linked from CSV ( or Excel/Google Sheet/JSON and others).


    Let me know if you have any additional questions.


    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables