#4425 - mysql.php update broke reading of custom news field (limited to 20 characters)

  • By
  • Added
  • 17 views
Identifier #4425
Issue type Minor issue (breaks specific functionality)
Title mysql.php update broke reading of custom news field (limited to 20 characters)
Status Closed (duplicate)
Handling member Chris Graham
Version 10.0.33
Addon failover
Description After upgrading from Composr 10.0.31 to 10.0.33, my custom news content field (which I originally added under Content -> News -> "Choose custom 'News article' fields" in the admin zone) was not being read from the database correctly. The original content was in a format like this:

[html]
<video-js id="content_video" class="video-js" controls preload="auto" autoplay="true" data-setup='{"aspectRatio": "16:9", "playbackRates": [0.5, 1, 1.5, 2], "html5": {"hls": {"overrideNative":true}}}' poster="thumbURL">
<source src="autoURL" type="application/x-mpegURL" res="9999" label="auto" />
</video-js>
<script src="/player/video.js"></script>
[/html]

What I was seeing instead, both on the rendered page and in the editor, was this:

[html]
<video-js id=

At first, I thought it was something to do with the quotation mark, but upon further testing, it's actually just limited to 20 characters. Before figuring that out, I found that rolling back mysql.php (by copying a backup from 10.0.31 to sources_custom/database/shared) fixed the issue. The only change in this file was:

switch ($type) {
case 'CHAR':
$_type = $type . '(65535)';
break;

Changing to:

switch ($type) {
case 'CHAR':
$_type = $type . '(20)';
break;
Steps to reproduce

1. Add a custom news field (Type: "A paragraph(s) of Comcode, with attachment support")

2. Turn off WYSIWYG editing and enter at least 21 characters of text in the custom news field.

3. Attempt to view or edit the news entry with that data in the custom field.

Additional information When trying to edit the custom field on 10.0.33, it looks like the full text entered into the editor is saved to the database properly (even if it's longer than 20 characters); however, if I click "Edit this," then immediately click "Save," the database is updated and everything past the first 20 characters is lost.

I've replicated this on two installations, happy to provide any further testing that's needed.
Related to

#4417 - Catalogue field text truncated (including custom fields)

Funded? No
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".

Rating

Unrated