Skip to content

Commit

Permalink
fix: Increase folder link field size (#26381)
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
  • Loading branch information
ankush authored and mergify[bot] committed May 9, 2024
1 parent e2f2cc4 commit a14f341
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions frappe/core/doctype/file/file.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
"fieldtype": "Link",
"hidden": 1,
"label": "Folder",
"length": 255,
"options": "File",
"read_only": 1
},
Expand Down Expand Up @@ -189,7 +190,11 @@
"icon": "fa fa-file",
"idx": 1,
"links": [],
<<<<<<< HEAD
"modified": "2023-12-08 15:52:37.525003",
=======
"modified": "2024-05-09 11:46:42.917146",
>>>>>>> 53517630ae (fix: Increase folder link field size (#26381))
"modified_by": "Administrator",
"module": "Core",
"name": "File",
Expand Down
2 changes: 1 addition & 1 deletion frappe/model/base_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,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, context=df.parent), max_length, value
reference, frappe.bold(_(df.label, context=df.parent)), max_length, value
),
frappe.CharacterLengthExceededError,
title=_("Value too big"),
Expand Down

0 comments on commit a14f341

Please sign in to comment.