Okay
  Public Ticket #2118858
class.wpdatatable.php on line 3604​​
Closed

Comments

  •  2
    Alejandro started the conversation

    After sometime to use wpdatatables plugin without any issue... Today a table start to give me this error Notice: Trying to get property 'connection' of non-object in   mysite/wp-content/plugins/wpdatatables/source/class.wpdatatable.php on line 3604

  •  2
    Alejandro replied

    Other error again creating a new table before I end to configurate all the table in the wpdatatables GUI

    Notice: Undefined index: undefined in ..../wp-content/plugins/wpdatatables/source/class.wpdatacolumn.php on line 602

  •  2,572
    Aleksandar replied

    Hello Alejandro.

    This is what's located on line 3605:

    $wpDataTable = $tableView === 'excel' ? new WPExcelDataTable($tableData->connection) : new self($tableData->connection);
            $wpDataTable->setWpId($tableId);
    

    So it could be an issue creating a table from an external file source, but I cannot say for sure.

    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.

    Also, please tell me what's the table ID, so I know where to look.

    Best regards.

    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

  •  2
    Alejandro replied

    Hi Aleksandar.

    Thanks you for your reply. Unfortunately we cant do that for security reasons. Anyway we recreate the tables that were doing problem and the problem fixed. 

    In addition I would want to ask you something else. 
    We have a field (type string) in mysql and it has a size of 500. Is there any restriction about the field size in wpdatatable plugin?. Because although a field has data (you can see in mysql) you cannot see in the wpdatatable GUI table.

    The field has a XML structure by the way. I thing that there is the problem. In a picture attached appear the field with the developer GUI but chrome does not show it of course.

    Any hook we could use before show the table in order to replace "<" and ">" ?

    Regards

    https://www.dropbox.com/s/r9n86o7wz5faume/xml%20field.PNG?dl=0

    Alejandro

  •  2
    Alejandro replied

    I'm going to leave the solution for anybody else. 

    I'm sure that someone could improve the code but here the main idea.

    Regards

    function wpdatatables_filter_string_cell( $formattedValue, $tableId ){
           if($tableId == 39){
                        if(substr($formattedValue,0,1)=="<"){
                               $formattedValue = str_replace( "<" , "<" , $formattedValue); 
                              $formattedValue = str_replace( "" , ">" , $formattedValue);
                         }  
           }
           return $formattedValue;   
    }
    add_filter( 'wpdatatables_filter_string_cell', 'wpdatatables_filter_string_cell',10,2 );



  •  2,572
    Aleksandar replied

    Hello Alejandro.

    Thanks for sharing that with everyone - greatly appreciated. I'll forward it to one of our developers, so they can take a look.

    As for this:

    We have a field (type string) in mysql and it has a size of 500. Is there any restriction about the field size in wpdatatable plugin?. Because although a field has data (you can see in mysql) you cannot see in the wpdatatable GUI table

    If you saved the column as String, with the editor input type being "One-Line edit", it was saved in the database as VARCHAR with the character limit set to 255. You would need to go into the database, and change the type of that column to TEXT, so you could enter a larger number of characters. In the future, just make a "Multi-line edit" string column, and this issue should be avoided.

    Best regards.

    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