Okay
  Public Ticket #1681647
multi string type size limitation
Closed

Comments

  • hrvr started the conversation

    I have created a table and setup a string data type with the edit setting to multiple line.  I have allowed the mysql filed to accept a varchar(2000) size for the field.  However, when i go over a certain size limit (well below 2000 chars) in the wpdatables modular field edit screen and select "OK" it actually does not save the value.  It appears there is a size limitation within wpdatatables for string types (multi line).  Can you tell me what that size limitation is and if there is a way for me to override the limit?  if fact if i go above the size limit on that field called "Description" it actually will cause a different field "phone" which is also string type (multi line) to blank out its contents.  ODD.  

    In further testing i have found it to be a problem between a string field defined as multiple lines in wpdatables.  If i press enter to add a second line in the wpdatables string multi line field and then click ok to save the record it says posting ok but nothing gets written to the mysql database and the wpdatable string field gets blanked out.  Here is the version information that is being used by bluehost.com.  If i type a long descritpton that wraps several lines in a wpdatables string type filed defined as multiple lines it will save ok.  It only blanks out and fails to save when i use the enter key to move to a new line that i have a problem with the saving to mysql. 


    versions

    cPanel70.0 (build 54)
    Apache2.2.34
    PHP7.0.31
    MySQL5.6.32-78.1
    Perl5.26.0

    Thanks..

  •  471
    Isidora replied

    Hi hrvresort,
    Thank you for your purchase.

    Sorry for late response. 

    We are located in Serbia and our working time is from 10:00 to 17:00 CET. business days.

    When you are creating manual tables and use One-line string in database will set column length on VARCHAR(255). IF you choose Multi-line string in database will be set column length on TEXT.TEXT is a string data type that can store up to 65,535 characters. TEXT is commonly used for brief articles.

    So when you create manual table and set One-line string and after crating table you change Editing type to Multi-line in database will stay length of VARCHAR(255).

    There is a limit on Mysql side that have limit where you can have a maximum row size of 65,535 bytes and if you have a lot of columns then you have to adjust sizes of column length in database so they fit in 65,535 bytes.

     All default settings for column type size you can find in function defineColumnProperties which you can find in file wp-content/plugins/wpdatatables/source/class.constructor.php around line 95. There you can reduce this sizes.


    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

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

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables

  • hrvr replied

    Still trying to figure out the issue... But this seems to work on the bluehost side but for whatever reason i don't have to do this on my local mamp installation for the multi-line to mysql with new line characters to work..

    I commented out the following code and it fixed the issues i was having with new line characters disappearing and not getting written to the mysql varchar(2000) field:

    I still wouldn't mind if you could provide an answer as to why commenting out this code would fix my issue.  Basically the code to remove characters from the string field to prevent XSS attacks was also removing the entire strings contents when it encountered any line with a newline at the end of the line.

        public static function prepareStringCell($string) {

     // rick removed      if (self::isHtml($string)) {
     // rick removed          $string = self::stripJsAttributes($string);
     // rick removed      }
            $string = self::wrapQuotes($string);
            return $string;
        }



    You can see the bolded field data on the bluehost server side fails to add the <br> tags when creating the wpdatable from the mysql server but you can see on my local install it does add the <br> tags.  Not sure why local it works and on bluehost it fails.  Only difference i can see is the 7.0 and 7.2 PHP versions.  

    ****************************************************************************

    bluehost wpdatatables view source missing <br> in the phone field


    <tr id="table_11_row_0">
                        <td style="">1</td>
                        <td style="">391</td>

                        <td style="">Rented for Winter Season</td>
                        <td style="">All Acceptable* RV's</td>
                        <td style="">Casita, Concrete Pad, Outdoor Furniture, Water Feature</td>
                        <td style="">0</td>
                        <td style="">900</td>
                        <td style="">Electric Included (max amount may apply), Water Included (max amount may apply),  Deposit Required,  4 Month min. during peak season</td>
                        <td style="">Rick Potter</td>
                        <td style="">519-464-7463
    519-584-8473

    </td>
                        <td style=""><a href='mailto:[email protected]'>[email protected]</a></td>
                        <td style="">this is a gtest of using mulka alksfjklas dfaskldf asldkfja sdflkas;ldkf as;lkdfj aslkdfja sdfklasdlkfjaslkd fal;ksdfja sdfaslkdf as;ldkfjaslk dflkasjdf aslkdfja sdfklasdjflkasdf jasdkl;f asl;kdjfkl asdflkjasdkl falksdjf lkasdjf asdf;lkajs dfasldjf asd. sadjflasdj fasdlfjask dflaksdjfk asdlkfjas dfasdf. asd;lfas kdfas;ldkfaj sdflkasdjfkla sdfas. aklsdfjklasdjflaksdfjlas df.asdf asdfkasdlkfalsd fasd. asdlkfjaskldfaklsdfja lsdflas. asdlfjaklsdfasd fasdlfaklsf as dlasd.fa sdflajsdlkfas d.</td>
    Photos
                        <td style="">Rpotter</td>
                        <td style="">Sun 08/19/2018  11:35 pm</td>

    *****************************************************************

    my local mamp wpdatatables view source has the <br> tags

    <td style="">1</td>
    <td style="">391</td>
    <td style=""><img src='http://localhost/havasurv_merged/wp-content/uploads/2013/04/Clubhouse-150x1501.gif' /></td>
    <td style="">Rented for Winter Season</td>
    <td style="">All Acceptable* RV's</td>
    <td style="">Casita, Concrete Pad, Outdoor Furniture, Water Feature</td>
    <td style="">0</td>
    <td style="">900</td>
    <td style="">Electric Included (max amount may apply), Water Included (max amount may apply), Deposit Required, 4 Month min. during peak season</td>
    <td style="">Rick Potter</td>
    <td style="">519-464-7463<br>519-584-8473</td>
    <td style=""><a href='mailto:[email protected]'>[email protected]</a></td>
    <td style="">Lot faces east so you will enjoy shade on the patio from the hot afternoon sun. There is a cement table with two chairs located at the rear of the lot to relax and enjoy the man made water fall and stream that flows past the lot. Lots of room for the largest RV and your toys. <br><br>test<br>test<br><br><br>atdsrasras<br>asdfasdfas<br>asdfasdf<br>asdfas<br>dfasdfasd<br>faasdfasdf<br><br>afasdfasdfasdfasd<br>fasdfas<br>dfasdf<br>asdfasd<br>fasdf<br><br><br>
    </td>
    <td style=""><a data-content='Photos' href='http://localhost/havasurv_merged/rental-listing-lot391/?lotnum=391' target='_blank'><button class=''>Photos</button></a></td>
    <td style="">Rpotter</td>
    <td style="">Mon 08/20/2018 12:40 pm</td>

    I have continued to troubleshoot and here is the latest info.

    I can enter multiple lines thru the phpmyadmin panel on bluehost no problem.  I have verified there is a newline character at the end of each line.  When i use wpdatables to look at that field in the wpdatatables linear tableview screen the field shows all entries on a single line even though the field is configured as a multi-line field.  When i copy the info from the linear field to an editor i can see the newline characters are not there (missing).  However when i go into the wpdatatable modular entry screen the entries appear on seperate lines and i have verified they special characters at the end of each line are in fact there.  it seems the wpdatatables linear tabelview screen is removing the end of line characters before rendering the table. It is also removing the entire field entry on a multi-line type fields if you use the enter key to move to new lines  and then try to save the data using the ok button. 

    php version on bluehost 

    PHP Version7.0.31

    php version on my mamp installation

    7.2.1

    Actually Milan, what is currently happening is that on the MySQL server I have the field type set as varchar(2000) and in wpdatatables I have the field defined as string, multi-line.  Even if I only enter only a single word  and then hit enter to go to a new line and enter another word then click on ok to save, the field goes blank and nothing is inputed to the MySQL field. I have even tried creating a second table to verify and it happens every time I use the renter key to add a line between text.  If I type a very long text message continuously and do not use enter it saves ok.  Now here’s the really odd thing, it works perfectly even when using enter to add new lines on my local mmap installation but doesn’t work with new lines on the bluehost installation. 

  •  471
    Isidora replied

    Hi hrvresort,

    Can you please tell me which version of libxml is installed on your server?

    You should find the libxml version in your php.info file.

    Commenting this lines solve your issue because it is probably installed lower version of libxml. If is possible to update this on latest versions(>2.9), if not then you will need to comment this lines of code after every update because it will be overwritten.

    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

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

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables

  • hrvr replied

    Ahh.. something interesting... on my local site that is working it is using libxml version 2.80 .. on the wordpress public site that i had to comment out your code it is using libxml version 2.76.  I will talk with wordpress and see what has to be done to update the libxml version.  Thanks Milan, you have been a great help!  

    This one was a tough one for me to troubleshoot.  :-)

  •  471
    Isidora replied

    Hi hrvresort,

    I am glad that we help you to figure out what cause the issue.

    If you have any more issues or questions feel free to open a new ticket, we will gladly help.

    We'd greatly appreciate it if you could take a minute and leave a Review on CodeCanyon on this link. Thanks! 

    Kind Regards, 

    Isidora Markovic

    wpDataTables: FAQFacebookTwitterFront-end and back-end demoDocs

    Amelia: FAQFacebookTwitter |  Amelia demo sites | Docs

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

    Powerful FiltersGravity Forms Integration for wpDataTablesFormidable Forms Integration for wpDataTables