[
https://issues.apache.org/jira/browse/OFBIZ-13346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18055368#comment-18055368
]
ASF subversion and git services commented on OFBIZ-13346:
---------------------------------------------------------
Commit 58781d68b6b33b3e06dccf61e5be092b9e4f649e in ofbiz-framework's branch
refs/heads/trunk from Florian Motteau
[ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=58781d68b6 ]
Improved: Avoid adding functions on jQuery object, remove use of internal
jQuery UI function (OFBIZ-13346) (#946)
- Rewrite getForm and getFormField functions as standalone functions
instead of adding them on
the jQuery prototype
- Update usages
- Remove usage of jQuery UI "form" internal method
(OFBIZ-13346)
Thanks: Néréide team
> Remove jQuery object custom function, avoid using internal jQueryUI function
> ----------------------------------------------------------------------------
>
> Key: OFBIZ-13346
> URL: https://issues.apache.org/jira/browse/OFBIZ-13346
> Project: OFBiz
> Issue Type: Task
> Affects Versions: 24.09.04
> Reporter: Florian Motteau
> Priority: Minor
> Fix For: Upcoming Branch
>
> Attachments: image-2026-01-21-17-15-58-560.png,
> image-2026-01-21-17-20-19-992.png
>
>
> In
> [https://github.com/apache/ofbiz-framework/blob/trunk/themes/common-theme/webapp/common-theme/js/util/OfbizUtil.js
>
> :|https://github.com/apache/ofbiz-framework/blob/trunk/themes/common-theme/webapp/common-theme/js/util/OfbizUtil.js,]
> !image-2026-01-21-17-15-58-560.png!
> The `_form()` function is an internal function from the UI component library
> jQuery UI (which returns the form DOM element from a form field). It should
> not be used outside of jQueryUI. This function war formerly named `form()`,
> then it has been renamed by jQueryUI, and then renamed too in this file. We
> should simply not use this function here.
> In the same file, there is this code :
> !image-2026-01-21-17-20-19-992.png!
> It's a bad practice to add functions or properties on a prototype that comes
> from an external library like jQuery. That can lead to confusion for future
> developers, or cause debugging difficulties if jQuery decides to add a
> `getForm` function in a future release.
> These functions should be standard standalone functions.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)