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
#	frappe/model/base_document.py
  • Loading branch information
ankush authored and mergify[bot] committed May 9, 2024
1 parent a0d22dc commit 9dfcbd1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 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,11 @@
"icon": "fa fa-file",
"idx": 1,
"links": [],
<<<<<<< HEAD
"modified": "2023-07-26 14:03:49.456951",
=======
"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
4 changes: 4 additions & 0 deletions frappe/model/base_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,11 @@ 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(
<<<<<<< HEAD
reference, _(df.label), max_length, value
=======
reference, frappe.bold(_(df.label, context=df.parent)), max_length, value
>>>>>>> 53517630ae (fix: Increase folder link field size (#26381))
),
frappe.CharacterLengthExceededError,
title=_("Value too big"),
Expand Down

0 comments on commit 9dfcbd1

Please sign in to comment.