Okay
  Public Ticket #1517724
Issue with string length
Closed

Comments

  • Joe Cooper started the conversation

    Hi there,

    WordPress Version: 4.9.4

    WordPress Multisite: Yes, using subdomains. However, the wpDataTables only appear one particular site in the network.

    wpDataTables Version: 2.1

    PHP Version: 7.0

    MySQL Version: 5.7.21

    I'm building a site for a client where they need to be able to have multiple data tables, these will all follow one template. I've created this template, and they will be simply duplicating it whenever they need to add a new table, this way all settings and tables structure will already be done for them.

    However, there's one really big issue. One of the columns, called "profile" requires for quite a large amount of text to be added per cell. However, whenever you add more than 255 characters, it returns the following error:

    "There was an error trying to update the row! Error: "

    After some research, I've realised that this is because in the database, the column "profile" has the type of varchar(255). If I change this to longtext, then it saves just fine.

    It's not really practical to ask the client to do this for every table they make, or for them to have contact me to do this each time.

    Is there any way specifying a column type directly within the wpDataTable? Maybe as a dropdown right next to "Column type" on the data table when editing a column? See screenshot.

    Or alternatively, do you offer any sort of WordPress filter / action / hook that can do this? Where I could write a function that is run upon saving a table, where it changes the MySQL column type value to "longtext" for a specific wpDataTable column?

    All the best

    Joe

  •  472
    Isidora replied

    Hi Joe,
    Thank you for your purchase.

    If you need more characters for specific column type you can change it in file wp-content/plugins/wpdatatables/source/class.constructor.php around line 95 you will find function defineColumnProperties where is set character limit. Also note that mysql have limit for characters in one row that is  65,535. If you  pass this limit you will not be able to make table.

    Also you can take a look in our documentation about Actions and Filters that is available in wpdatatables.

    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

  • goshdamo replied

    Can that be an option in the front end? I'd really like to use this plugin more often but having to change that each time i do an update would be a pain.?

  •  472
    Isidora replied

    Hi goshdamo,

    When you have questions or issues which are not related to the title of the active ticket or if tickets is not yours can you please open a new one and we will help you there. In that way, issues and questions which are related to different subjects will be in different tickets so other customers can find it easily. Our policy is to have one issue or question per ticket because of the reasons that is describe already.

    Thank you for understanding.

    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