Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Views Bootstrap 5.5.4 — Minor update available for module views_bootstrap (5.5.4). Release: Rightup theme 1.0.3 — Minor update available for theme vartheme_bs5_rightup (1.0.3). Release: CommentOn 1.0.6 — Minor update available for module commenton (1.0.6). Release: ChatGPT Ads 1.0.3 — Minor update available for module chatgpt_ads (1.0.3). Release: Opensolr Search 5.1.3 — Minor update available for module opensolr_search (5.1.3). Release: ServiceM8 Webform Integration 1.2.1 — Minor update available for module servicem8_webform (1.2.1). Release: PostfixAdmin 1.0.0 — Initial release available for module postfix_admin (1.0.0)! Release: ip_analyser 1.0.3 — Minor update available for module ip_analyser (1.0.3). Module Revived: Swagger-PHP OpenAPI 3 documentation generator 1.0.0 — Module swagger_php updated after 10 months of inactivity (1.0.0). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage.

File Managed Alter

This is simple utility module that enables you to increase the length of the
'uri' field used by the 'file_managed' table which is in turn used by Drupal's
'file' entity. This module increases the maximum length from varchar(255) to
varchar(2048).

Background

By default, in Drupal there is a restriction of 255 chars on the varchar size or
length of the uri field in the file_managed table. In some circumstances this
is not sufficient and may result in an exception.

e.g.

ResponseText: The website encountered an unexpected error. Please try again later.Drupal\Core\Entity\EntityStorageException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'uri' at row 1: INSERT INTO "file_managed" ("uuid", "langcode", "uid", "filename", "uri", "filemime", "filesize", "status", "created", "changed") VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array

Reasons to increase the uri length

Microsoft Internet Explorer has a maximum uniform resource locator (URL) length
of 2,083 characters. Internet Explorer also has a maximum path length of 2,048
characters.

If you are using the GET method, you are limited to a maximum of 2,048
characters, minus the number of characters in the actual path.

RFC 2616, "Hypertext Transfer Protocol -- HTTP/1.1," does not specify any
requirement for URL length.

Reasons to NOT increase the uri length

Other modules both core and contrib may make assumptions about the length of
this field.

Usage

Typically in Drupal, updates to the database schema are only allowed when using a
hook_update. This modules provides a means of doing this one off operation.
Simply install this module then run the update.php script e.g. `drush updb` or
if preferred via the admin UI.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Mar 2023
Latest release
3 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core Release date
1.0.x-dev Dev Mar 13, 2023