Commit Graph
10472 Commits
Author SHA1 Message Date
Jacques Le Roux 488b9b6b9a Improved: Checks if the value passed to checkStringForHtmlSafe is not null (OFBIZ-11822)
This was reported by SpotBugs in Eclipse to prevent a possible NPE.

It seems to me that it's more complex than that because of the
PolicyFactory::sanitize methods signatures where @Nullable annotation is
used. So the SpotBugs warning remains, anyway can't hurt.

BTW found 92 issues reported by SpotBugs in Eclipse, among them 33 are "scary"

I had to add 1 to tasks.checkstyleMain.maxErrors because of
https://github.com/apache/ofbiz-framework/pull/203 that I pulled after the push
was rejected by the pre-push local Git hook
2020-06-16 14:05:16 +02:00
Jacques Le Roux df828419be Fixed: Double encoded urls are not being decoded (OFBIZ-11822)
This was broken by OFBIZ-10275

Thanks: Alex Bodnaru
2020-06-15 13:25:35 +02:00
Jacques Le Roux 88bda0b4dc Improved: Install a Checkstyle pre-push (on every committer machine?) (OFBIZ-11304)
Updates tasks.checkstyleMain.maxErrors to 26842
Remove a trailing space in RequestHandler I used to test the pre-push hook.

In the previous commit (c4b5f5e) I have pushed a pre-push hook rather than a
pre-commit hook. I think it makes sense. I noticed that this does not clear the
existing pre-commit hook in .git\hooks. You have to clear it by hand.

But anyway I believe we should rather use a webhook as Suggested by Samuel and
proposed by Infra. This for at least 3 reasons:
    Handles PRs and not only local commits
    Minimise the CPU usage locally
    Simplify usage for custom projects

I think it's the best solution but I'll continue the discussion on dev ML about
2020-06-13 10:09:48 +02:00
Jacques Le Roux c4b5f5ec2c Test locally <<hooks = ['pre-push': 'checkstyleMain']>> 2020-06-13 09:41:59 +02:00
James Yong 33deb94501 Improved: Allow definition of external style sheet in multi-block html template (OFBIZ-11819)
External style sheet in html template will be extracted to layoutSettings.styleSheets when multi-block=true.
2020-06-12 14:12:45 +08:00
Priya SharmaandPriya Sharma 5c5af78ffe [Improved]: Overloaded groovy utility method to handle error logging with only throwable object as parameter. (OFBIZ-11762) (#194)
Co-authored-by: Priya Sharma <priya.sharma@example.com>
2020-06-08 13:35:15 +02:00
James Yong f21dbd6d74 Improved: multi-block attribute for html-template tag (OFBIZ-11686)
Add CSRF token support for 'getJs' request uri.
2020-06-07 14:33:16 +08:00
Suraj Khurana c00e61aa18 Improved: Enforce noninstantiability to LoginWorker class. (#175)
(OFBIZ-11747)

Made class as final, added private constructor and made static variables as private.
2020-06-07 10:55:06 +05:30
James Yong 4e563a67ff Fixed: showHelp not working (OFBIZ-11803)
Fixed Navigation tree is not displayed in showHelp page.
2020-06-06 19:49:26 +08:00
Priya SharmaandPriya Sharma 15aec7e8f7 WIP: [Improved]: Use GroovyBaseScript's logging utility methods instead of using Debug (OFBIZ-11762) (#185)
* [Improved]: Use GroovyBaseScript's logging utility methods instead of using Debug
- Replaced the debug.log methods with the respective groovy utility method
- Enhanced the GroovyBaseScript to entertain the fetch the current class name as the module name for logging
- Overloaded the logError method to entertain throwbale object for better logging
- Removed unused import statements and module variables.

(OFBIZ-11762)

* [Removed]: Extra line spaces. (OFBIZ-11762)

* [Revert]: Unwanted changes. (OFBIZ-11762)

* [Added] Same changes to these files. (OFBIZ-11762)

Co-authored-by: Priya Sharma <priya.sharma@example.com>
2020-06-06 10:17:23 +02:00
James Yong e3f6d1547f Improved: Headerize external script in multi-block html template (OFBIZ-11741)
Fix regression in scrumtests that resulted in NullPointerException.
2020-06-06 14:28:32 +08:00
Suraj Khurana 846e5f0ded Improved: Enforce noninstantiability to GroovyUtil Class. (#180)
(OFBIZ-11778)

Made class as final, moved default constructor and renamed private data members as per naming convention best practices.
2020-06-06 10:03:33 +05:30
Suraj Khurana 924df4b217 Improved: Enforce noninstantiability to ConfigXMLReader Class (#178)
(OFBIZ-11746)

Made class as final, added private constructor and corrected private data members as per naming convention.
2020-06-06 10:01:55 +05:30
James Yong 347ea63479 Improved: Headerize external script in multi-block html template (OFBIZ-11741)
Improve function for adding links to layoutSettings
2020-06-06 10:23:41 +08:00
holivier 211540a966 Documented: Help link using asciidoc files via generated html
(OFBIZ-11693)

Migrate AccountingHelData.xml to added some <set field="helpAnchor" to
the correct screens

Now in accounting component only asciidoc documents are used, help link
area now link to userDocUri
(ci.apache.org/projects/ofbiz/site/trunk/ofbizdoc as default value in
general.property)
2020-06-05 15:15:21 +02:00
holivier 192059e3da Improvement: Help link using asciidoc files via generated html
(OFBIZ-11693)

Change release for all asciidoc files, now there area 3 publish site,
one per release
* site/trunk
* site/next   currently for the 18.12
* site/stable currently for the 17.12
2020-06-04 17:56:54 +02:00
holivier d79d7c50b8 Improvement: Help link using asciidoc files via generated html (OFBIZ-11693)
1. Add a general property: userDocUri containing uri for
ofbiz.apache.org html user-documentation generated by Buildbot
2. in each theme, add a test on helpAnchor field, if it's define help
link is now on ${userDocUri}#${helpAnchor}
  * if userDocUri is not defined, the general property is used
2020-06-04 17:42:23 +02:00
Suraj Khurana e92becb0fd Improved: Enforce noninstantiability to ServiceGroupReader Class. (#177)
(OFBIZ-11750)
Made class as final, added private constructor and corrected private data member name as per naming convention.
2020-06-04 14:38:22 +05:30
Suraj Khurana 65c235704c Improved: Enforce noninstantiability to JobUtil Class. (#176)
(OFBIZ-11749)
Made class as final and added private constructor.
2020-06-03 16:08:49 +05:30
Suraj Khurana 9423bfdcc5 Improved: Enforce noninstantiability to ExpressionUiHelper Class. (#173)
(OFBIZ-11748)

Made class as final, added private constructor and corrected private data member naming convention.
2020-06-03 16:05:30 +05:30
Pawan Verma 8cac7f1fc5 Fixed: startup-service does not work without runtime-data-id(OFBIZ-11668) 2020-06-02 17:25:16 +05:30
Jacques Le Roux 4b55e07505 Improved: Headerize external script in multi-block html template (OFBIZ-11741)
Fixes Javadoc issues
2020-06-01 07:52:59 +02:00
James Yong a5ab3961fa Improved: Headerize external script in multi-block html template (OFBIZ-11741)
Allow expression in template location.
2020-05-31 23:31:49 +08:00
James Yong f85040ff04 Improved: Headerize external script in multi-block html template (OFBIZ-11741)
Allow expression in template location.
2020-05-31 17:42:42 +08:00
James Yong d1a22a6ba8 Improved: Headerize external script in multi-block html template (OFBIZ-11741)
Cleanup script cache when session ended
2020-05-30 14:32:38 +08:00
James Yong c0e527efb2 Improved: Headerize external script in multi-block html template (OFBIZ-11741)
Allow external scripts within the multi-block html template, to be rendered
within the html head tag, when a new attribute data-import is set to “head”

Thanks: Jacques for review
2020-05-30 12:00:21 +08:00
Nicolas Malin 1558f232c2 Fixed: Remove unnecessary semi-column 2020-05-29 16:29:32 +02:00
holivier 1f673804a4 Improved: put simple-method optional for compound file (OFBIZ-11645) 2020-05-29 11:54:50 +02:00
holivier 097db39ee0 fixed: sort-order (field) not works in CompoundWidgets file (OFBIZ-11708)
In a form, when <sort-order tag is used, the children analyze not works
because, getTagName() is used not the getLocalName(). getTagName()
return "wf:sort-field" when getLocalName return "sort-field".
So change getTagName() to getLocalName() for sort-order children
2020-05-29 11:43:58 +02:00
holivier e4ee439e27 Fixed: drop-down field not work when in a compound-widget file (OFBIZ-11676)
When, in ModelFormField, FieldInfoWithOptions (which read xml file ) is
call, test on tag name is done with getName() and not getLocalName() so
none "option" is recognize when field is declare on a compound-widget
file. getName() is change to getLocalName()
2020-05-29 11:26:40 +02:00
Suraj Khurana abc7836dde Improved: Made MODULE as private data member of class instead of public in all framework components.
(OFBIZ-11739)
This will reduce checkstlye issues. Thanks Jacques for review.
2020-05-29 13:20:46 +05:30
Jacques Le Roux 10b8acd5d1 Improved: removes useless "@deprecated No replacement" comments in Java code
This follows a discussion on dev ML 5 days ago.
Those comments are useless because they are all related to Minilang and Minilang
is deprecated as a whole.
2020-05-27 09:26:56 +02:00
Pierre Smits 5fac98022e Improved: quote menu
(OFBIZ-11715)

updated: QuoteTabBar - simplified labels
updated: moved 'Edit quote' menu item to QuoteSubTabBar
updated: reordering of menu-items of QuoteTabBar
updated: various UiLabels used by menu-items in QuoteTabBar
2020-05-24 14:34:03 +02:00
James Yong 767390ad89 Improved: Apply multi-block attr to each application (OFBIZ-11706)
1. Bug Fix
2. Disable multi-block until function is stabilized.
2020-05-23 14:08:35 +08:00
holivier 205914a1be Improved: just remove trailing space 2020-05-22 11:47:55 +02:00
James Yong e675f0a79f Improved: Apply multi-block attr to each application (OFBIZ-11706)
1. Fix missing Boundary Comment at beginning
2. Apply multi-block attr
2020-05-22 00:54:20 +08:00
Jacques Le Roux 32a71c9af4 Improved: Clean how HTTP vs HTTPS is handled
(OFBIZ-11717)

No functional changes, just better comments
2020-05-20 13:01:36 +02:00
Jacques Le Roux 4bdfb54ffb Fixed: Apache OFBiz unsafe deserialization of XMLRPC arguments (CVE-2020-9496)
(OFBIZ-11716)

Because the 2 xmlrpc related requets in webtools (xmlrpc and ping) are not using
authentication they are vulnerable to unsafe deserialization.

thanks: Alvaro Munoz <pwntester@github.com> from the GitHub Security Lab team
2020-05-19 15:58:06 +02:00
Pawan Verma 3b7e63744c Improved: Expansion of form widget field disabled atrribute with xsd improvement (#141)
(OFBIZ-10432)

1. Added disabled attribute support in ModelFormField with xs:boolean type
2. Removed specific field level disabled attribute support for CheckField and TextField
3. Modified existing usage of disabled attribute as per new implementation.

Thanks: Rishi for the report and Taher, Gil and Jacques for the feedback
2020-05-19 17:37:24 +05:30
Pawan Verma ba463ab9bc Fixed: Issue with redirect queryParameters when the user is logged out
(OFBIZ-11714)

In OFBIZ-10539, We missed removing the line which was adding parameters into the map as Ritesh suggested a good way to handle parameters. I've removed that redundant line of code and attaching a patch for the same.
2020-05-19 17:21:11 +05:30
Jacques Le Roux d640a711d1 Improved: Prevent FreeMarker Template Injection (SSTI)
(OFBIZ-11709)

Better style with line not too long
2020-05-18 22:52:30 +02:00
Jacques Le Roux 09baa5537e Improved: Prevent FreeMarker Template Injection (SSTI)
(OFBIZ-11709)

Previous code compiled but SAFER_RESOLVER is not a class but a field, better KISS
2020-05-18 14:39:25 +02:00
Jacques Le Roux a6e8b05135 Improved: Prevent FreeMarker Template Injection (SSTI)
(OFBIZ-11709)

Some people may want to use another TemplateClassResolver than SAFER_RESOLVER
This creates a new templateClassResolver security property and uses it in
FreeMarkerWorker::makeConfiguration by default
2020-05-18 12:06:28 +02:00
James Yong e3e12ee487 Improved: No need to specify externalKeyParam in ofbizUrl calls (OFBIZ-11711)
Let ofbizUrl macro generates externalLoginKey when needed.

Thanks: Jacques for review
2020-05-17 20:37:48 +08:00
Pierre Smits 6e4fd2968a Improved: descriptions of temporal expression records (OFBIZ-11584) (#64)
* Improved: descriptions of temporal expression records

(OFBIZ-11584)

* Improved: descriptions of temporal expression records

(OFBIZ-11584)
2020-05-17 10:28:15 +02:00
Jacques Le Roux e46c29962b Fixed: Prevent FreeMarker Template Injection (SSTI)
(OFBIZ-11709)

Since Freemarker 2.3.17 a known solution to these issues is to register a
TemplateClassResolver in Freemarker configuration in order to limit which
TemplateModels can be instantiated in the templates. The predefined resolver
SAFER_RESOLVER doesn't allow to instantiate the Execute class[4].

So the solution is to add the line
    newConfig.setNewBuiltinClassResolver(TemplateClassResolver.SAFER_RESOLVER);
in FreeMarkerWorker.java
2020-05-16 20:51:12 +02:00
Jacques Le Roux ccabbd8e4e Fixed: Have a service that runs periodically to generate CustomTimePeriod records
(OFBIZ-10905)

Fixes the loading sequence of CommonScheduledServicesDemoData.xml now
ScheduledServicesDemoData.xml in service component
2020-05-16 13:25:17 +02:00
James Yong 47e6b9cad6 Improved: Apply multi-block attr to each application (OFBIZ-11706)
Fix regresssion
2020-05-16 17:51:34 +08:00
Pierre Smits 50857f1505 Implemented: Have a service to periodically create PeriodRecords (OFBIZ-10905) (#133)
* Implemented: Have a service that runs periodically to create CustomTimePeriod records

(OFBIZ-10905)

added: service createFuturePeriod
added: function createFuturePeriod called by createFuturePeriod
added: SystemProperty records called by createFuturePeriod function
added: JobSandbox record to schedule createFuturePeriod service
added: ref to CommonScheduledServicesDemoData.xml in component.xml

* Implemented: Have a service that runs periodically to create CustomTimePeriod records

(OFBIZ-10905)

improved: description

* Implemented: Have a service that runs periodically to create CustomTimePeriod records

(OFBIZ-10905)

improved: groovy code aligning to code formats
2020-05-16 11:03:13 +02:00
James Yong 591b0442c7 Improved: Apply multi-block attr to each application (OFBIZ-11706)
For Webtools, Themes.
2020-05-15 21:25:12 +08:00