Okay
  Public Ticket #2867068
Modification of Max String Length
Closed

Comments

  • Mike started the conversation

    Hi,

    I created a new table and loaded it from a spreadsheet but noticed the string fields only took the first 255 characters of the corresponding spreadsheet cell.

    From looking through old tickets, it appears to me that I can override this by modifying the varchar around line 149 of wp-content/plugins/wpdatatables/source/class.constructor.php.  Can you verify this is correct?

    If I do change it and create my table – I assume future updates to WPDATATABLES will reset class.constructor.php back to varchar(255) but my table will still remain as I created it?

    Thanks, Mike

  •  2,507
    Aleksandar replied

    Hello Mike

    Thank you for reaching out to us.

    If you're linking to the spreadsheet, the plugin recognizes the size of the fields and saves the column as multi-line string, but it looks for the first 10 rows if I'm not mistaken. So, if the string that's longer than 255 characters is found on a lower row, it will be saved as single-line string.

    If you're importing the file, you can change the type when you're creating the table, so if you save it as "Multi-line string", it will accept 56.000 character-long strings.

    You are correct about class.constructor.php - you can change it, but it will be overwritten in the next update, so you'll have to do it again. I'll reach out to our developers, hoping they can alter the code, so you don't have to make the modification every time.

    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

  • Mike replied

    Alexsandar,

    Worked exactly as you said when I set the fields to multi-line BEFORE loading the spreadsheet - previously I waited until after the load which was (now obviously) too late.

    I figured there was probably a better way than manually editing class.constructor.php.

    As usual, you guys have already anticipated my issue and, as usual, your great response and customer service continues to impress me.

    Thanks much,
    Mike


  •   Aleksandar replied privately