Skip to content

Commit

Permalink
fix: Increase folder link field size (#26381) (#26383)
Browse files Browse the repository at this point in the history
* fix: increase folder length to 255

File `name` is 255 because it's bootstrapped using mariadb.sql, so users
can create 255 char long folders but can't store anything in it.

* fix(UX): slightly better character len message

Highlight field by making it bold.

(cherry picked from commit 5351763)

# Conflicts:
#	frappe/core/doctype/file/file.json
#	frappe/model/base_document.py

Co-authored-by: Ankush Menat <ankush@frappe.io>
  • Loading branch information
mergify[bot] and ankush committed May 9, 2024
1 parent a0d22dc commit 30db235
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions frappe/core/doctype/file/file.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
"fieldtype": "Link",
"hidden": 1,
"label": "Folder",
"length": 255,
"options": "File",
"read_only": 1
},
Expand Down Expand Up @@ -188,7 +189,7 @@
"icon": "fa fa-file",
"idx": 1,
"links": [],
"modified": "2023-07-26 14:03:49.456951",
"modified": "2024-05-09 11:46:42.917146",
"modified_by": "Administrator",
"module": "Core",
"name": "File",
Expand Down Expand Up @@ -220,4 +221,4 @@
"states": [],
"title_field": "file_name",
"track_changes": 1
}
}
2 changes: 1 addition & 1 deletion frappe/model/base_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ def throw_length_exceeded_error(self, df, max_length, value):

frappe.throw(
_("{0}: '{1}' ({3}) will get truncated, as max characters allowed is {2}").format(
reference, _(df.label), max_length, value
reference, frappe.bold(_(df.label)), max_length, value
),
frappe.CharacterLengthExceededError,
title=_("Value too big"),
Expand Down

0 comments on commit 30db235

Please sign in to comment.