4412 Commits
Author SHA1 Message Date
Jacques Le Roux 21860f7192 Fixed: Integration tests fail with Postgres DB (OFBIZ-12666)
This fixes testUpdateFixedAssetMaintAndWorkEffort. It works in both Derby and
Postgres

Thanks: Johannes Schreiber for report
2022-07-18 08:36:31 +02:00
Jacques Le Roux f7c583a1a1 Improved: Update build.gradle to the latest dependencies (OFBIZ-12658)
I handled <<addProperties(String,Schema) in Schema has been deprecated>>
Just needed to replace by addProperty(String,Schema) for each case
2022-06-27 15:40:17 +02:00
Jacques Le Roux 7f8ec07b53 Fixed: Update Solr and Lucene from 8.11.1 to 8.11.2 for security reason (OFBIZ-12656)
There was fixed security issues in Solr:
https://lists.apache.org/thread/wn9wkmx1ogbf00hj78y2xt3l0bo15ob9
Not in Lucene, but we need sync between them:
https://lists.apache.org/thread/olf2bhqy1ws9f0kp9nb8zs6g5dcl89l5
2022-06-22 11:46:47 +02:00
Jacques Le Roux 67cbf35e83 Improved: Sorl external logging is not working, but a bit in console (OFBIZ-12646)
After removing useless system properties used to handle logging in
OFBizSolrContextFilter.java with commit 102eb51153
that had a wrong commit title
<<Improved: Unable to upload a file through ecommerce (OFBIZ 12636)>>
and message that should have been:
<<Remove useless system properties used to handle logging. Maybe previously this
was working but it was then long ago.

Also speeds things a bit while loading Solr by using the not so obvious
SOLRHOME_ATTRIBUTE servlet attribute rather than the "solr/home" system property

Note: this is a 1st cleaning step and we are still missing external logging>>

I forgot to remove the related properties in solrconfig.properties, this does it
2022-06-17 17:34:55 +02:00
Jacques Le Roux 102eb51153 Improved: Unable to upload a file through ecommerce (OFBIZ-12636)
Allows to check for only CSV files. This is not used OOTB in OFBiz.

Thanks: Sachin for report and confirmation it's OK
2022-06-16 16:48:43 +02:00
Jacques Le Roux e18d5768ac Improved: Ecommerce Error Page Does Not Work (OFBIZ-4390)
Currently when an error occures in ecommerce or ecomseo CsrfUtil::checkToken
throws the RequestHandlerException "Invalid or missing CSRF token for AJAX call..."

It's only disturbing in log for no benefit. This feature seems obsolete and
we should rather get rids of it.

I don't backport in case I'd proved wrong
2022-06-11 14:43:08 +02:00
Pierre Smits 34ba24e439 Fixed: AssetMaint not accessible by user with 'VIEW' permission (OFBIZ-12485) (#71)
Currently the AssetMaint application is not accessible by a user with the VIEW permission, as demonstrated with userLoginId = 'auditor'.

Modfied: AssetMaintSecurityGroupDemoData.xml: added SecurityGroupPermission record
2022-05-12 20:02:13 +02:00
Jacques Le Roux f8cb563d18 Improved: Screen projectmgr main is taking long time to load when projects are more (OFBIZ-12606)
When projects are more than 1000, main screen of projectmgr component is taking
very long time  to load.
Currently it is loading all available projects in one shot and there is
"ProjectIsBillable.groovy" which is calling in row-actions

Solution : We can use performFind service  to increase performance in this screen

jleroux: I have just removed the commented out replaced code and changed the new
<field name="createdStamp"
by
<field name="createdDate" map-name="resultProject.projectInfo"
Also automatically removed few trailing blanks

Thanks: Balaji Yendamuri for the patch
2022-05-03 11:58:22 +02:00
Nicolas Malin 070c3c09d5 Fixed: Request createWorkEffortPartyAssign generates an error (OFBIZ-12556)
The request createWorkEffortPartyAssign is called after submitting the form AddWorkEffortPartyAssign, when the user wants to add a party to a project. This raise an error because it removed from workeffort component after the screen dynamising
Thanks to Pierre Smith for raise this issue and Martin Naumann for the fix patch
2022-04-22 11:59:04 +02:00
Jacques Le Roux eac1fb508f Improved: projectView doesn't show the newly created project after creation ( (OFBIZ-12601)
"Previously" the project creation directly lead to the ProjectView screen within
the context of the newly created project. In this way users were able to
directly add e.g. resources to the newly created project without selecting it
again within the FindProject screen. Within the patch provided I just copied the
success handling from the updateProject request mapping which seems to restore
the initial functionality again.

jleroux: Even if I don't know to what to compare in past, I indeed see no
reasons to not do so.

Thanks: Sixty One for the patch
2022-04-20 09:36:20 +02:00
Jacques Le Roux 2ddb605ae8 Fixed: Solr requires application/x-www-form-urlencoded (OFBIZ-12600)
Solr plugin fires exception on create/update of a product.

1.) enable eca in solrconfig.properties: solr.eca.enabled=true
2.)  enable all eca in eecas.xml
3.) start ofbiz
4.) update or create a product (go to product and save it)
the error is fired.

Thanks: Ingo Wolfmayr for report
2022-04-14 15:44:14 +02:00
Jacques Le Roux 5792f452a9 Fixed: Test run was unsuccessful because of failing solr tests (OFBIZ-12595)
The previous commit for OFBIZ-12594 was only working on Windows. On *nix OSs
there is no way to reliably get "--test" String from java.class.path property.

Also the previous fix was brittle because relying only on 1 space separating
words.

This fix puts in the SolrDispatchFilter system property at the beginning of the
4 Solr tests and removes it at end of them. That presence can reliably be tested
in ControlFilter that is called before SolrDispatchFilter. It allows to bypass
SecurityUtil::containsFreemarkerInterpolation that would else change the
parameters content type that must be application/x-www-form-urlencoded.
content

Thanks: Tom Pietsch for report and Mart Naum for confirmation
2022-04-13 14:38:15 +02:00
Jacques Le Roux 4cce082e93 Improved: no functional change, adds GitHub Actions build status emails.
As the name suggests, these are emails that notify of either a failed build
using GitHub Actions, or a change from failure in previous builds to a
successful build. Continuously successful builds will not trigger emails, as
that could be rather spammy.

Please see the documentation on this at: https://s.apache.org/asfyaml-gha
2022-04-02 13:13:22 +02:00
Jacques Le Roux 265cc7f83e Improved: Remove deprecation warning by removing direct call to Class::newInstance
Class.newInstance() has a flaw, in which any Throwable from the constructor is
thrown unchecked. It was deprecated in Java 9, but not marked for removal.
It shows as a deprecation warning when compiling OfBiz with Java 11.

Thanks: Heinz Kabutz for reporting and initially committing 0e6732b. This
completes in plugins and all will we backported
2022-04-01 10:41:55 +02:00
Jacques Le Roux daa5f74b42 Improved: no functional change, adds GitHub Actions build status emails.
As the name suggests, these are emails that notify of either a failed build
using GitHub Actions, or a change from failure in previous builds to a
successful build. Continuously successful builds will not trigger emails, as
that could be rather spammy.

Please see the documentation on this at: https://s.apache.org/asfyaml-gha
2022-03-29 13:43:19 +02:00
Jacques Le Roux a7bb363932 Improved: no functional change, removes misleading comment
The Base64 class no longer exists
2022-03-05 11:04:41 +01:00
Jacques Le Roux 0da1f22334 Improved: no functional change simple formatting 2022-02-28 18:27:30 +01:00
Jacques Le Roux 20ce270211 Improved: no functional change, removes commented out request-maps since 2009
See https://markmail.org/message/upeivoflev5de3ke
2022-02-24 09:28:20 +01:00
Michael Brohl a38685f23d Improved: Update Redoc to v2.0.0-rc.59 (OFBIZ-12520) 2022-02-22 23:44:55 +01:00
Michael Brohl cea04fea0f Improved: Update to Swagger UI 4.2.1 (OFBIZ-12519) 2022-02-22 23:43:45 +01:00
Benjamin Jugl 82f6198e2e Fixed: Setting VIEW_INDEX to 0 in ForumScreens.xml when not initialized (OFBIZ-11429) 2022-02-22 22:57:16 +01:00
Jacques Le Roux 9d66988c5b Fixed: placeholder text has been implemented but seems to do nothing (OFBIZ-12548)
Adding this to a form in a widget/somethingForms.xml file:

<field name="description" title="${uiLabelMap.CommonDescription}"
required-field="true"><text placeholder="This is placeholder text"/></field>

Does not throw a error, but when the form is displayed, no placeholder text
appears.  I've checked the html code in the browser to confirm that it wasn't
white placeholder text on a white background, and it does not define the
placeholder property in the generated html.

Are there any cases where placeholder text does work?  If so, it would be nice
if a working example could be added somewhere (like someone in ofbiz,
or maybe in the "example" plugin)

Thanks: ddev for report and spotting the missed commit of
OFBIZ-5341-Example.patch in OFBIZ-5341
2022-02-01 08:48:08 +01:00
Jacques Le Roux 35af177893 Improved: Migrate Ofbiz bb 0.8 config to 3.2 (OFBIZ-12456)
No functional change (adds a space in LICENSE file) to test the RAT Buildbot
config
2021-12-31 19:44:47 +01:00
Jacques Le Roux 9d491ca801 Improved: Migrate Ofbiz bb 0.8 config to 3.2 (OFBIZ-12456)
No functional change (remove a space in LICENSE file) to test the RAT Buildbot
config
2021-12-31 16:32:43 +01:00
Jacques Le Roux 02b243eede Improved: Migrate Ofbiz bb 0.8 config to 3.2 (OFBIZ-12456)
No functional change (adds a space in LICENSE file) to test a change in new
Buildbot config

Incremental changes are really necessary and it's a pain (no syntax checker) :/
2021-12-28 17:03:06 +01:00
Jacques Le Roux a5b5e5055f Improved: Migrate Ofbiz bb 0.8 config to 3.2 (OFBIZ-12456)
No functional change (removes a space in LICENSE file) to test a change in new
Buildbot config
2021-12-28 12:51:33 +01:00
Jacques Le Roux 7e4dc9a353 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Fixes a typo automatically put in by
https://github.com/apache/ofbiz-tools/blob/master/wiki-files/OFBizJavaFormatter.xml
I have not the guts to change that :/ Maybe later...
2021-12-28 11:42:33 +01:00
Jacques Le Roux b3a0b8344c Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
In GitHubEvents::gitHubRedirect and LinkedInEvents::linkedInRedirect  random
object created and used only once.

Fixes a typo for MESSAGE_LABLES

Adds a FIXME in OFBizCasAuthenticationHandler::OFBizCasAuthenticationHandler.
It's only an "empty" constructor supposed to "initializes some required member
variables". I see nothing happening here and it's never called, remove it?
2021-12-28 09:42:32 +01:00
Jacques Le Roux 424b238582 Improved: Migrate Ofbiz bb 0.8 config to 3.2 (OFBIZ-12456)
No functional change (adds a space in LICENSE file) to test a change in new
Buildbot config
2021-12-27 15:46:47 +01:00
Jacques Le Roux 82c5a574fb Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
I wrote in previous commit:
"uses <<private static final SecureRandom SECURE_RANDOM = new SecureRandom();>>
in classes:
PaymentGatewayServices
ValueLinkApi
ContactMechServices
ProductStoreWorker
DesCrypt
HashCrypt
EntityCrypto
ContextFilter.java
Despite doing so SpotButs still reports the same error for those classes.
As it's obviously an error I prefer to not excludes those cases that will maybe
not be reported in a future version of SpotButs in Eclipse. For instance they
are not reported at all in previous version (4.5.1) but are in 4.5.2"

Actually it turn out to be that I needed to remove the SpotBugs markers.
SpotBugs is mischievous. Sometimes just when fixing a report in a file it
automatically updates the tree of reports, most of the time not. Sometimes you
don't need to remove the SpotBugs markers. Just running again clears the tree of
reports.

Anyway I was inspired to not exclude the reported cases for the classes above.
They no longer appear, but a new one popped up (or I missed it previously but
I doubt) in SampleHtmlThread::run.

This fixes it and it no longer appears when just running SpotBugs again,
go figure...
2021-12-26 15:26:33 +01:00
Jacques Le Roux ac6acf03a3 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Random object created and used only once in
OFBizCasAuthenticationHandler.rand(int, int)
SampleHtmlThread.run()

This code creates a java.util.Random object, uses it to generate one random
number, and then discards the Random object. This produces mediocre quality
random numbers and is inefficient. If possible, rewrite the code so that the
Random object is created once and saved, and each time a new random number is
required invoke a method on the existing Random object to obtain it.

If it is important that the generated Random numbers not be guessable, you must
not create a new Random for each random number; the values are too easily
guessable. You should strongly consider using a java.security.SecureRandom
instead (and avoid allocating a new SecureRandom for each random number needed).

Rank: Troubling (14), confidence: High
Pattern: DMI_RANDOM_USED_ONLY_ONCE
Type: DMI, Category: BAD_PRACTICE (Bad practice)
2021-12-26 13:32:04 +01:00
Jacques Le Roux efb113250d Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
In ReportEncoder::createString == should not be used but equals should
2021-12-26 13:23:49 +01:00
Jacques Le Roux 57ef5c81d3 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Before analysing issues with apiKey and baseUrl static vars, just better formatting
More to test a change in Buildbot config actually
2021-12-24 11:32:16 +01:00
Jacques Le Roux 537a4591e2 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
We don't fear collisions for "servletContext". It's only initialised by
contextInitialized() and then only read before being destroyed by
contextDestroyed()

Also initialises servletContextto null
2021-12-23 17:13:54 +01:00
Jacques Le Roux 1eeb4026e6 Improved: fixes an indentation 2021-12-22 09:19:12 +01:00
Jacques Le Roux 921fee3c0c Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
In OFBizActiveDirectoryAuthenticationHandler class, fixes a possible NPE:

Immediate dereferencement of the result of readLine()
(NP_IMMEDIATE_DEREFERENCE_OF_READLINE)

The result of invoking readLine() is immediately dereferenced. If there are no
more lines of text to read, readLine() will return null and dereferencing that
will generate a null pointer exception.
2021-12-21 14:19:40 +01:00
Jacques Le Roux 55c7d157f5 Fixed: Update Solr and Lucene to address several CVEs (including Log4j) (OFBIZ-12464)
Solr and Lucene 8.11.1 are now available in Maven Central
2021-12-18 17:01:56 +01:00
Jacques Le Roux c5539184e0 Improved: no functional change, just fix 2 JavaDoc (no real pb just syntax) 2021-12-18 11:47:13 +01:00
Jacques Le Roux a02c8ba350 Fixed: Update Solr and Lucene to address several CVEs (including Log4j) (OFBIZ-12464)
Solr is not yet available on Maven :/

We will also need to update Tika, and I guess the list will continue...
2021-12-17 05:14:19 +01:00
Jacques Le Roux 4f26a91aec Fixed: Update Solr and Lucene to address several CVEs (including Log4j) (OFBIZ-12464)
See SOLR-15843 and
https://solr.apache.org/guide/8_11/solr-upgrade-notes.html
https://solr.apache.org/docs/8_11_1/changes/Changes.html#v8.11.1.bug_fixes

Also fixes luceneMatchVersion in solrconfig.xml, was forgotten last times
And clarifies comments about that
2021-12-16 17:18:14 +01:00
Jacques Le Roux 8d4aebb836 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
In OFBizActiveDirectoryAuthenticationHandler class, removes the feeding of an unused
var ctx

In OFBizLdapAuthenticationHandler class, removes the feeding of an unused var ctx

In AbstractReportThread class, fixes few typos
2021-12-16 17:08:38 +01:00
Michael Brohl f33ff27059 Fixed: Typo in debug log message. 2021-12-15 16:53:09 +01:00
Jacques Le Roux 5a69c225af Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Simple JavaDoc formatting in AbstractReportThread

Fixes 3 REC_CATCH_EXCEPTION bugs in EbayOrderServices and 1 in
ImportOrdersFromEbay, ie:
<<This method uses a block try-catch that catches
Exception objects, but Exception is never fired in this block, and
RuntimeException is not explicitly intercepted.
It is a common mistake to say that
try / catch (Exception e) is the same as many
try / catch, but this twist also intercepts
RuntimeException, hiding potential bugs.>>

Also some formatting and useless comments removed in both classes.
2021-12-11 15:39:03 +01:00
Jacques Le Roux 576d5534a2 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
In AbstractPricatParser::writeCommentsToFile fixes a possible null
dereferencement
Fixes 2 JavaDoc issues
2021-12-10 10:26:42 +01:00
Jacques Le Roux 7b78e25f31 Improved: better JavaDoc 2021-12-10 08:49:12 +01:00
Jacques Le Roux 21c9f0fda9 Improved: add a log error message in AbstractPricatParser::getCellContents
When there are no cells to get content from
2021-12-10 08:11:58 +01:00
Jacques Le Roux b5cad1d5e1 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
In PricatParseExcelHtmlThread::storePricatFile try to fixes a possible null
dereferencement but does not work (weird).
The error is NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE

In OpenApiUtil::getSchemaForEntity fixes a possible null dereferencement
2021-12-09 11:59:29 +01:00
Jacques Le Roux 1f0cca7fa4 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Renames BirtEngineServlet class to OfbizBirtEngineServlet, because it shadowed
the simple name of it superclass.
It can be exceptionally confusing, create lots of situations in which you have
to look at import statements to resolve references and creates many
opportunities to accidentally define methods that do not override methods
in their superclasses.

Also remove trailing spaces in OpenApiUtil class
2021-12-05 12:59:59 +01:00
Jacques Le Roux cf086a2b47 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
In GitHubEvents::gitHubRedirect, random object created and used only once.

This code creates a java.util.Random object, uses it to generate one random
number, and then discards the Random object. This produces mediocre quality
random numbers and is inefficient. If possible, rewrite the code so that the
Random object is created once and saved, and each time a new random number is
required invoke a method on the existing Random object to obtain it.
Also fixes 2 Javadoc errors

In SampleHtmlThread, uses SecureRandom rather than Random class

In LinkedInEvents::linkedInRedirect, uses SecureRandom rather than Random class
Also fixes 2 Javadoc errors
2021-12-05 09:55:08 +01:00
Jacques Le Roux 923b42c2da Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Fixes possible null dereferencings in
EbayHelper::createPayment,
AbstractPricatParser::writeCommentsToFile
SolrProductSearch::getSideDeepCategories
WebPosEvents::getProductType
2021-12-05 09:55:08 +01:00