Okay
  Public Ticket #2751191
One or more columns doesn't have a header. Please enter headers for all columns in order to proceed.
Closed

Comments

  • Roman started the conversation

    Hello, i use this plugin WPDatatables for few months in my site and has a lot of functionality in it.
    After one of your last updating i see new issue which wasn't before.
    First time when i tried to fix it , it has broken my table and i had to revert my site back https://prnt.sc/11g4cdz

    I tried to set these headers directly in database but it didn't help and i still has this error in some of my tables and can't fix it.

     Previous versions of plugin don't have this issue so pls advise how can i fix it?
     and pls fix it in new next version of plugin.

    because i need to revert previous version of plugin for good working of it, it's very dangerous error which doesn't allow to do some fixes for it.

    Pls advise how can we fix this issue and where?

  •  2,572
    Aleksandar replied

    Hello Roman

    That's just a warning, so it's not rendering the plugin useless, but I can understand that it's annoying for you.

    This is actually an improvement for the plugin, and it only occurs on tables linked to Excel, Google Sheets, XML, JSON, PHP or CSV files, or when you try to import a file that contains at least one column without a header.

    It's an improvement because it's not advisable to have a column without a header - it can cause a lot of issues in the plugin, so we've added it as a warning. When the plugin creates a table from an external data source (regardless if it's linked to the data source, or imported), it's looking at the values present in the table. 

    That's why we included that warning, so it tells you that the file needs to be modified, so there are no empty columns or columns without a header.

    Tables linked to an existing data source are creating the structure for the table in wp_wpdatatables_columns database table, and its preferences are saved in wp_wpdatatables. The structure can't be properly configured due to these empty headers. You may be aware that SQL doesn't allow empty headers, so it's confusing (if I can use that word), what it's supposed to do with the info that doesn't exist - hence, the error.

    Please go to file wp-content/plugins/wpdatatables/source/class.wdtconfigcontroller.php and on line 635 you will find this:

    try {
                foreach ($dataSourceColumnsHeaders as $dataSourceColumnsHeader)
                    if ($dataSourceColumnsHeader == '') throw new WDTException(__('One or more columns doesn\'t have a header. Please enter headers for all columns in order to proceed.'));
            } catch (WDTException $exception) {
                die($exception);
            }

    Comment those lines, like this:

    //        try {
    //            foreach ($dataSourceColumnsHeaders as $dataSourceColumnsHeader)
    //                if ($dataSourceColumnsHeader == '') throw new WDTException(__('One or more columns doesn\'t have a header. Please enter headers for all columns in order to proceed.'));
    //        } catch (WDTException $exception) {
    //            die($exception);
    //        }
    

    And it should work as it used to.

    However, we will not revert this to an earlier state, so either modify the files used to generate the table so every column contains a header, or comment these lines of code each time the plugin is updated.

    Kind Regards, 

    Aleksandar Vuković
    [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

  • Roman replied

    Hello,  ok, thank you for your answer.

    I'll check this moment.

    I just had the problem then when i tried to change this header from empty header to another one via wpdatatables admin  then table became broken after it and i got critical error https://prnt.sc/11i6fyr.

    So pls tell me the best way to change this empty headers, from admin panel in this table in which i have these empty headers or maybe i should go to phpmyadmin and there i should change sql code of it  https://prnt.sc/11i6k5z  in wpdatatbles table, *content* column https://prnt.sc/11i6pgg right ?

    for example:

    sql code for table was 

    *

    SELECT 
       1 AS '',
       t.spacname,
       t.industry,
    ...

    *

    and this point when header was '' then i had issue.


    should i go to this table in phpmyadmin and will change it to 

    *

    SELECT     

    1 AS 'not_empty_header',

     t.spacname,   

     t.industry, ...

    *

    should i do it by this way ? 

    or there are other ways too also? 

    pls advise

  • Roman replied

    i have a lot of functionality in wpdatatables tables so i need to find the safest way to change empty headers in all tables when i have it without losting data of these tables.
    pls advise here the best ways for it.

  • Roman replied

    And one more question here?

    Pls advise how can we increase page speed of pages which are using wpdatatables functionality?

    Maybe there is some place where we can configure the maximum configuration for it? Load time limit or something like that?

  •  2,572
    Aleksandar replied

    Hi again Roman

    It's strange that you see this error on MySQL tables - they need to have origin headers by default, so you can simply remove "AS "" from the query - lose the alias, and load it with:

    SELECT 
       1,
       t.spacname,
       t.industry,

    ...

    What issues are you having with the loading speed, and is it happening on all tables, and all pages? The page load usually depends on the amount of data in the table, amount of data on the page, server performance and hosting plan.

    Kind Regards, 

    Aleksandar Vuković
    [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