Commit Graph
27737 Commits
Author SHA1 Message Date
Daniel Watford 7830328bb4 Improved: Removed deprecated ExpectedException.none from tests
(OFBIZ-12137)

Prevents logging of deprecation warnings during the build.
2021-01-14 17:07:40 +00:00
Jacques Le Roux 9acee84312 Improved: decreases tasks.checkstyleMain.maxErrors from 286 to 279
Thanks: Daniel
2021-01-13 22:46:10 +01:00
Daniel Watford d40081dc86 Improved: Minor changes to reduce checkstyle warnings count 2021-01-13 14:28:19 +00:00
James Yong 9c7dc7b877 Improved: Rename MultiBlockHtmlTemplateUtil to ScriptLinkHelper (OFBIZ-12134)
Rename + Refactor
2021-01-13 09:26:42 +08:00
Nicolas Malin e0a840a0c4 Implemented: Access to the current screen from any widget element
(OFBIZ-11809)

During the rendering process, an element have no information about the screen which is dependent from. This not really help to automate some refresh treatment and force the developer to know the screen structure where is the element.

To solve this situation we implement a new class, ScreenStack that allow anytime for any element to identify its direct dependency. This help to resolve the unique Id that the screen take and can be used by the theme.

At any time a developer can retrieve the screen reference with uel function screen:id(screenStack)

example:
     <container id="${screen:id(screenStack)}">

The object screenStack is always present during a rendering process.
2021-01-12 17:48:00 +01:00
James Yong 3c83ab53b2 Refactoring 2021-01-12 23:25:25 +08:00
Daniel Watford 3795727ea2 Improved: MacroFormRenderer refactoring of label, display and text
fields

(OFBIZ-11900)

New RenderableFtl elements to represent pre-rendered FTL strings and FTL
macro calls. RenderableFtl elements are able to render themselves to
strings which are processed as an FTL template by the FtlWriter class.

For labels, display fields and text fields, MacroFormRenderer no longer
generates FTL to write to a template itself, but instead calls
RenderableFtlFormElementsBuilder to create corresponding RenderableFtl
elements which are then processed by FtlWriter. This is a WIP to reduce
complexity in MacroFormRenderer.
2021-01-12 10:40:58 +00:00
James Yong d32814e5c8 Fixed: Incorrect date format in tooltip (OFBIZ-12123)
Tooltip should show the date format used by the picker.
2021-01-12 12:32:53 +08:00
James Yong 25adbd2088 Fixed: Date picker not initialised in ajax-called form (OFBIZ-12097)
Fixed regression. Manual entry is cleared after moving to next field.

Thanks: Olivier for reporting
2021-01-12 11:11:01 +08:00
Daniel Watford c9ee842163 Fixed: Issue starting ofbiz from tar distribution (OFBIZ-12118)
Avoid using caches when opening a URL connection to read an XML resource
in a JAR file.

If caches were used when running from the ofbiz.jar file then attempts
to read resources from the jar would fail due to the cached file's
InputStream already being in a closed state.

Thanks: Eugen Stan for the bug report and fix.
2021-01-11 17:35:07 +00:00
Suraj Khurana cc17887980 Improved: Added support to calculate distance between two geo points.
(OFBIZ-11901)
Thanks Ravi Lodhi for review and discussion.
2021-01-09 13:37:21 +05:30
James Yong 067db8fe9e Improved: Open Menu file from browser (OFBIZ-12119)
User can open menu definition file from the browser by clicking on the named border.
2021-01-09 13:05:23 +08:00
James Yong f484b0d318 Fixed: Open Screen file from browser (OFBIZ-12038)
Fix named borders not rendered for sub-screens.
2021-01-06 23:23:35 +08:00
James Yong ba5536fe57 Improved: Apply CSS Grid to Find Orders (OFBIZ-12116)
Improve naming
2021-01-03 11:13:13 +08:00
Jacques Le Roux fbca7a434a Happy new year to all :) 2021-01-02 19:06:34 +01:00
James Yong 6f3c7cb4c2 Improved: Apply CSS Grid to Find Orders (OFBIZ-12116)
Apply CSS Grid Layout on the form.
Keep related fields together
2021-01-02 12:46:44 +08:00
James Yong a66f0a9be8 Improved: Change inline style to js for multiple select field (OFBIZ-12115)
Test pages at /ordermgr/control/FindRequest and /ordermgr/control/findorders
2021-01-01 13:13:46 +08:00
Jacques Le Roux 66decd89f7 Improved: Create 'New Communication' button should be removed from create new communication screen. (OFBIZ-12027)
Steps to replicate the issue :
Go to Party application.
On the 'find communications' screen clicks on the 'New communications' button.
The system will navigate you to create/edit communications screen.
On create/edit communications screen you will see the 'New communications' button.

Providing the 'New communications' button on the 'create new communication
screen' does not make any sense over so it should be removed from here.

Thanks: Shubham Choudhary
2020-12-29 11:28:16 +01:00
James Yong 816a2a6ac1 Reverted: apply buttontext class for links inside screenlet title bar (OFBIZ-12112)
Links not showing correctly for themes like Bluelight, Tomahawk.
This reverts commit 9d0e5313
2020-12-27 15:29:03 +08:00
James Yong 9d0e5313bc Improved: apply buttontext class for links inside screenlet title bar (OFBIZ-12112)
For Order application
2020-12-26 20:25:47 +08:00
James Yong 451f42a21c Improved: Do not limit form width if asm_formSize is not defined (OFBIZ-12102)
Extend the same behavior to SetMultipleSelectJs.ftl.
2020-12-26 17:08:22 +08:00
Jacques Le Roux c7e1114b74 Fixed: partymgr fails to upload image (OFBIZ-12101)
This is a bug due to OFBIZ-12080, fileToCheck is the complete name of the file
with path not the filename

Thanks: Wai for report
2020-12-26 09:06:02 +01:00
James Yong f561c41ea0 Improved: Do not limit form width if asm_formSize is not defined (OFBIZ-12102)
Changed at SetMultipleSelectJsList.ftl.
Tested page at /ordermgr/control/FindRequest
2020-12-26 13:14:07 +08:00
Jacques Le Roux 0fc14af687 Improved: Remove hardcoded product category on CategoryWorker.getCatalogTopCategory (OFBIZ-12078)
When you call the java function
org.apache.ofbiz.product.category.CategoryWorker.getCatalogTopCategory()
the catalog returned if the system failed found it is hardcoded and don't use an
existing property : catalog->top.category.default

Thanks: Nicolas
2020-12-25 17:02:52 +01:00
Jacques Le Roux 6110ced974 Fixed: Unique form names for promo actions (OFBIZ-12082)
Creating a promo with multiple rules and actions results in an exception.

It's reproducible by creating a promo with 1 rule and more than 1 Action and
specifying different products for each Action. When creating the second Action
and trying to specify another product to included the ajax request LookupProduct
will fail because it included both product ids in its xhr request.

Thanks: Danny Trunk
2020-12-25 16:17:35 +01:00
Jacques Le Roux 3cdd1fcec7 Fixed: Issue in creating promotion action (OFBIZ-11168)
The issue reported there was fixed with OFBIZ-11058.

But there was still an issue in logI reported in a comment.

The problem was that
<#assign productPromoActionCurEnum = productPromoAction.getRelatedOne("ActionEnumeration", true)>
was used in 2 places where it should not have been because it returned a null
value that can't be handled by OFBiz.

Better use
<#assign productPromoActionCustomMethod = productPromoAction.getRelatedOne("CustomMethod", true)>
and
productPromoAction.getRelatedOne("ActionEnumeration", true))??

The repercussion was that the description was not used but the Id and the log
was showing an error.
2020-12-25 16:09:43 +01:00
Jacques Le Roux 1cc035db22 Documented: why not upgrading org.jdom:jdom:1.1.3
Better comment
2020-12-25 15:54:33 +01:00
James Yong 203fa5f1c1 Implemented: Support Freemarker square interpolation syntax (OFBIZ-12099)
Use square interpolation syntax when file extension is .spi.ftl
2020-12-21 19:46:11 +08:00
Jacques Le Roux 12bb7489e3 Documented: why not upgrading org.jdom:jdom:1.1.3 2020-12-20 17:10:07 +01:00
Jacques Le Roux a0d8eb86a0 Fixed: Update build.gradle to the latest dependencies (OFBIZ-12092)
Forget about upgrading org.jdom to v2 we need only JDOMException and it works
as is. So this reverts to  org.jdom to v1. We still need the updated entry in
build.gradle

This fixes integration tests with framework only
2020-12-20 13:52:28 +01:00
Jacques Le Roux 72d3dd18ac Fixed: Make ruleName field in PriceForms.xml#AddPriceRules safe (OFBIZ-12098)
I noticed an issue due to entity-auto. Unlike with a standard service you can't
protect fields using allow-html="safe" except by overriding fields. So in case
this must be done one by one...

An example is ruleName field in PriceForms.xml#AddPriceRules with
createProductPriceRule and updateProductPriceRule services

This fixes this only case...
Also removes trailing blanks and only that (by IDE setting)
2020-12-20 11:13:39 +01:00
James Yong cc90994a4f Add notes to js funcs 2020-12-20 15:01:09 +08:00
James Yong 483e77ea83 Fixed: Date picker not initialised in ajax-called form (OFBIZ-12097)
Use inline script when request is ajax
2020-12-20 08:46:52 +08:00
Jacques Le Roux c52f29e0ae Fixed: Post-auth XSS vulnerability at catalog/control/EditProductPromo (OFBIZ-12096)
We missed to unescape EcmaScript encoded strings in
UtilCoded::checkStringForHtmlSafe, ie in all form fields using allow-html="safe"

Thanks: 牛治 <niu.zhi@zte.com.cn> for report
2020-12-19 20:54:08 +01:00
Jacques Le Roux c7fef0c409 Fixed: Post-auth XSS vulnerability at catalog/control/EditProductPromo (OFBIZ-12096)
We missed to unescape EcmaScript encoded strings in
UtilCoded::checkStringForHtmlSafe, ie in all form fields using allow-html="safe"

Thanks: 牛治 <niu.zhi@zte.com.cn> for report
2020-12-19 18:24:29 +01:00
Jacques Le Roux 3355c64f4c Fixed: Update build.gradle to the latest dependencies (OFBIZ-12092)
After last changes jdom is missing when using framework only, certainly due to a
3rd party lib change that included it.

This fixes the issue, by not only adding last jdom lib ('org.jdom:jdom:2.0.2')
in build.gradle but also changing the import where used: they changed to jdom2!
2020-12-19 14:54:04 +01:00
James Yong 71a0d6b4db Improved: Change inline style to class for wait-spinner (OFBIZ-12095)
Add code missed in earlier commit
2020-12-19 13:10:47 +08:00
James Yong d3801256df Improved: Change inline style to class for wait-spinner (OFBIZ-12095)
Inline style not encouraged by Content Security Policy
2020-12-19 12:42:28 +08:00
James Yong 798822c94f Fixed: wait spinner doesn't show when running ajaxUpdateArea (OFBIZ-12094)
Use setTimeout() after running waitSpinnerShow() to ensure wait spinner icon is displayed properly.
2020-12-19 09:19:34 +08:00
Jacques Le Roux 393f80fadd Fixed: Update build.gradle to the latest dependencies (OFBIZ-12092)
Back to 1.4.1 because of w/ 1.7.0 an EntityCrypto exception when loading data
2020-12-18 16:29:52 +01:00
Jacques Le Roux 6c34142b60 Improved: Update build.gradle to the latest dependencies (OFBIZ-12092)
According to BuildBot after last changes jdom is missing, certainly due to a 3rd
party lib change.
I could not reproduce locally, I guess if I had cleared the cache it would.
Anyway here it is.
2020-12-18 14:24:02 +01:00
Jacques Le Roux ec2b84341e Reverted: "Improved: Hyperlink target-type attribute is deprecated and should be replaced by url-mode (OFBIZ-12091)"
This reverts commit 17eb2e4cf7.

It does not work when using <<target="javascript:........>>
I could change those cases but it's easier and safer to simply revert back to
target-type!

Thanks: James for report
2020-12-18 11:08:32 +01:00
Jacques Le Roux 333b896eef Fixed: Error wIth Flat Grey theme related to rest component (OFBIZ-12093)
When you use the Flat Grey theme (useful for RTL languages) you see an error in
the main menu (component choise). It's related to the rest component not using a
controller.

Fixes is simple and has not side effect: instead of throwing an exception simply
log a warning and return an empty string
2020-12-18 10:38:26 +01:00
Jacques Le Roux f016e5da23 Improved: Update build.gradle to the latest dependencies (OFBIZ-12092)
Shiro could be updated to 1.7.0 this time (w/o code changes)
2020-12-17 18:44:29 +01:00
Jacques Le Roux c4650ff9bc Fixed: Secure the uploads (OFBIZ-12080)
According to https://s.apache.org/rpzog, adds few, maybe redundant, Java
API/methods found in webshell, or alike, source code
2020-12-14 19:00:37 +01:00
Jacques Le Roux 179dd2411a Fixed: Secure the uploads (OFBIZ-12080)
Follows OWASP advice on file names:

All the control characters and Unicode ones should be removed from the filenames
and their extensions without any exception. Also, the special characters such as
“;”, “:”, “>”, “<”, “/” ,”\”, additional “.”, “*”, “%”, “$”, and so on should be
discarded as well.

If it is applicable and there is no need to have Unicode characters, it is
highly recommended to only accept Alpha-Numeric characters and only 1 dot as an
input for the file name and the extension; in which the file name and also the
extension should not be empty at all
(regular expression: [a-zA-Z0-9]{1,200}.[a-zA-Z0-9]{1,10}).

So if someone needs other chars in uploaded filenames a change will be needed
2020-12-14 16:46:05 +01:00
Jacques Le Roux 63e2b526b8 Fixed: Secure the uploads (OFBIZ-12080)
Prevents too long filenames as recommended by OWASP.

Based on https://security.stackexchange.com/questions/46484/denial-of-service-when-uploading-a-file#answer-46495
I decided to not limit sizes of files. Anyway we know it's only post-auth...
2020-12-14 12:46:32 +01:00
Jacques Le Roux 93fb762071 Improved: Add unique identifier data to portlet context (OFBIZ-12090)
Add the portalPortletId + portletSeqId to the portlet context. This is useful if
a unique identifier within the portlet body (the portlet content) is required.

Thanks: Ingo Wolfmayr
2020-12-12 19:39:31 +01:00
Jacques Le Roux 99a446c7b6 Improved: Gradle logging hygiene (OFBIZ-12085)
Some times ago, we were forced to stop and quickly restart the demos because of
the Gradle daemons logging taking all the place; though we don't use Gradle
daemons in demos. Weird isn't ?

The reason is that by default org.gradle.logging.level=lifecycle is verbose.
Anyway, all org.gradle.logging.level are verbose. I mean they also duplicate
OFBiz information, have a look into your own Gradle daemon dir!

And that even if you don't use daemons, as we do for demos. Because Gradle
always uses at least 1 daemon to run.

So I was looking for a solution to not uselessly clutter the VM disk demos and
stumbled upon <<Gradle logging hygiene - Issue #2688>> - gradle/gradle (github.com)

This uses Evgeny Naumenko's solution at
https://discuss.gradle.org/t/gradle-daemon-produces-a-lot-of-logs/9905

I backport because it's needed by demos
2020-12-11 17:58:54 +01:00
Jacques Le Roux 17eb2e4cf7 Improved: Hyperlink target-type attribute is deprecated and should be replaced by url-mode (OFBIZ-12091)
Same for sub-hyperlink
2020-12-11 16:52:04 +01:00