Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294795

Allowed file extensions Widget Input/Display Length Problem

$
0
0

Summary

There is an input/display interaction problem with the File widget edit form's "Allowed file extensions" input field.

Current Operation

  • The "Allowed file extensions" field allows extensions to be separated by either a space or a comma. e.g. "txt doc rtf"
  • When it displays the extensions, they are separated by both a space and a comma. e.g. "txt, doc, rtf"
  • The field has a length restriction of 128.

Problem Statement

It is possible to enter field data which can be saved once, but not can be saved if the field is edited at a later time.

Example

  • If you enter a list of 30 extensions, each 3 characters long separated by a space, the line length is 119 characters (30x4-1) and will be saved.
  • When the field is displayed on the next edit the field value now has an extra character per extension. The space has been transformed into a space plus comma. The length is now 148 characters (30x5-2) and can not be saved.
  • Error message: Allowed file extensions cannot be longer than 128 characters but is currently 148 characters long

Work Around

Edit the field content to remove commas or spaces.

Possible Solutions

  • Display the extensions separated by only a space
  • Make the length checking sophisticated enough to take the input and display differences into account

Viewing all articles
Browse latest Browse all 294795

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>