?
Related to # 20724
avatar brainforgeUK
brainforgeUK
8 Feb 2018

Steps to reproduce the issue

Create a custom field plugin which allows user to enter more than 65536 bytes of data.

Expected result

All bytes of data stored in database and returned.

Actual result

Data gets truncated to 65535 bytes

System information (as much as possible)

Joomla 3.8.5
MySQL 5.7.10

Additional comments

Column value of table #__fields_values is currently defined as TEXT
This should be changed to LONGTEXT

For comparison see columns introtext and fulltext of table #__content

There may be other issues related to the length of the data, which I have not investigated so far, but the database restriction is a showstopper!

avatar brainforgeUK brainforgeUK - open - 8 Feb 2018
avatar joomla-cms-bot joomla-cms-bot - labeled - 8 Feb 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 8 Feb 2018
Title
Joomla custom field data length
[com_fields| Joomla custom field data length
Priority Urgent Medium
avatar joomla-cms-bot joomla-cms-bot - edited - 8 Feb 2018
avatar brainforgeUK
brainforgeUK - comment - 9 Feb 2018

Changed the database column to LONGTEXT on test system and achieves the objective without any obvious issues.

ALTER TABLE #__fields_values CHANGE value value LONGTEXT;

See this plugin
https://github.com/brainforgeUK/plg_fields_bffile


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19618.

avatar brianteeman
brianteeman - comment - 28 Feb 2018

if memory serves me correctly querying a longtext field has performance issues

avatar brainforgeUK
brainforgeUK - comment - 1 Mar 2018

True, but then why are columns introtext and fulltext of table #__content LONGTEXT ?
The current configuration provides an unacceptable constraint on usability.
A compromise might be to have two types of fields. As existing plus a long field feature.

avatar brianteeman brianteeman - labeled - 25 Mar 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 7 Apr 2018
Status New Discussion
avatar joomla-cms-bot joomla-cms-bot - unlabeled - 7 Apr 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 13 Jun 2018
Rel_Number 0 20724
Relation Type Related to
avatar wilsonge wilsonge - change - 19 Aug 2018
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2018-08-19 16:06:48
Closed_By wilsonge
avatar wilsonge
wilsonge - comment - 19 Aug 2018

I don't see this being something that we're going to choose to do anything with. If you're storing that much custom field data then you are almost certainly needing a CCK or you're own table to store data in depending on what your doing

avatar wilsonge wilsonge - close - 19 Aug 2018
avatar BrainforgeUK
BrainforgeUK - comment - 19 Aug 2018

The current implementation is inconsistent with columns introtext and fulltext of table #__content
The current configuration provides an unacceptable constraint on usability.
Using CCK adds an unnecessary level of complexity.

avatar mbabker
mbabker - comment - 19 Aug 2018

If you are putting that much text into a custom field value then honestly I would say you are doing something wrong and need to be using your own database table.

The introtext and fulltext columns are the way they are because they are designed for entering full text articles. In that context, it would not be acceptable to limit to 65535 bytes (which includes all the HTML and shortcodes for plugins to dynamically alter content). That is not the same use case as custom fields and using the argument "but this column is this long so others should be too" is a non-argument.

avatar BrainforgeUK
BrainforgeUK - comment - 19 Aug 2018

I have PDF documents for the data of typically less than 1MB.
The article permissions provide all the security needed.

If people want to use it for videos etc of 1GB or more then, true, they should be considering an alternative. I cannot see a reason for not changing the database to LONGTEXT.

avatar mbabker
mbabker - comment - 19 Aug 2018

Someone just do a pull request lengthening all of our core fields to the max length for the stored data types and be done with it. That way we can once and for all put a stop to these "database is limiting what I can do" issues.

avatar brianteeman
brianteeman - comment - 19 Aug 2018

You are putting the contents of a pdf inside a field?

avatar HLeithner
HLeithner - comment - 19 Aug 2018

if memory serves me correctly querying a longtext field has performance issues

No performance difference between "TEXT" and "LONGTEXT" except it needs 2 bytes more in the Database field. There is only a performance penalty (or gain) between "(VAR)CHAR" and (TINY/MEDIUM/LONG)TEXT.

avatar BrainforgeUK
BrainforgeUK - comment - 19 Aug 2018

This is the site that started this...
https://lifelineromania.org.uk/stories-newsletters/newsletters

I think tomorrow I'll put a pull request in for this one column.
I'll leave other columns hinted at by mbabker to those affected by them.

Add a Comment

Login with GitHub to post a comment