Skip to content

Commit

Permalink
fix: show relative path in loaded JS (#23964)
Browse files Browse the repository at this point in the history
[skip ci]

(cherry picked from commit a16db1b)
  • Loading branch information
ankush authored and mergify[bot] committed Dec 27, 2023
1 parent 5dbe282 commit 3f01c53
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frappe/desk/form/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from frappe.model.meta import Meta
from frappe.model.utils import render_include
from frappe.modules import get_module_path, load_doctype_module, scrub
from frappe.utils import get_html_format
from frappe.utils import get_bench_path, get_html_format
from frappe.utils.data import get_link_to_form

ASSET_KEYS = (
Expand Down Expand Up @@ -122,7 +122,9 @@ def _get_path(fname):
def _add_code(self, path, fieldname):
js = get_js(path)
if js:
comment = f"\n\n/* Adding {path} */\n\n"
bench_path = get_bench_path() + "/"
asset_path = path.replace(bench_path, "")
comment = f"\n\n/* Adding {asset_path} */\n\n"
sourceURL = f"\n\n//# sourceURL={scrub(self.name) + fieldname}"
self.set(fieldname, (self.get(fieldname) or "") + comment + js + sourceURL)

Expand Down

0 comments on commit 3f01c53

Please sign in to comment.