We don't fear collisions for "url". It's only used in testXmlRpcRequest during
a sole test, write that in exclude.xml
Also removes an unused MODULE in XmlRpcTests class
ComparableRange is a super class of DateRange that is Serializable. So
ComparableRange needs to be Serializable Too. Same with AbstractJob for PurgeJob
and GenericServiceJob
Renames ControlServlet class to OfbizControlServlet, 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.
Same for XmlRpcClient.java
At https://markmail.org/message/3mhzlqew3igad3r2 I reported an issue that I was
not able to really qualify. After exchanging with a Checkstyle expert
(see markmail thread).
I was unable to find what in our checkstyle.xml file was wrongly throwing these
warnings. I decided that there was no reason to throw those warnings.
So I decided to put the SuppressionCommentFilter in our checkstyle.xml file and
use CHECKSTYLE_OFF: ALMOST_ALL/CHECKSTYLE_ON: ALMOST_ALL around
the concerned lines as documented here
https://checkstyle.sourceforge.io/config_filters.html#SuppressionCommentFilter_Examples
This definitely solves all issues by introducing a CacheFilter and
RequestWrapper classes inspired by several works found on the Net.
Also moves the change introduced before in ContextFilter to CacheFilter.
The basic problem is that you only can use once
ServletRequest::getInputStream or the ServletRequest::getReader
Also not both, even once, ie they can be seen as same from this POV.
The integration tests all pass.
Also replace the checked String "</serializable>" by "</serializable" as, like
reported by Jie Zhu, the former could be bypassed by using "</serializable >"
Thanks: Jie Zhu for report
When you call a groovy script from an event controller, some information are present note on the same place on the binding context.
Example if you call a groovy script as service you found the userLogin with parameters.userLogin or when you call it as event, the userLogin is on the binding context root.
The problem appear with the DSL method 'run service' who search the missing value need by a service (userLogin, locale and timezone) on the map parameters on the binding context, so failed to populate correctly the information for an event.
Call from event
Map serviceResult = run service: 'createInvoice', with: [partyId: partyId, invoiceDate: nowTimestamp]
Failed due to security issue : missing userLogin on the service context.
Improve the groovy dsl with a success method that return directly all fields
Previously we used:
Map result = success()
result.myId = myId
return result
Now we can write:
return success(myId: myId)
Or
Previously we used:
Map result = success('Wonderful !')
result.myId = myId
return result
Now we can write:
return success('Wonderful !', myId: myId)
Improve the groovy dsl with a simple method 'label' to resolve an uiLabel instead of use 'UtilProperty.getMessage()' on groovy script.
Previously we used:
UtilProperties.getMessage("AccountingUiLabels", "AccountingUpdatePaymentPermissionError", 'locale'))
Now we can write:
label("AccountingUiLabels", "AccountingUpdatePaymentPermissionError")
This prevented to run the stable demo, hence the next, weirdly the trunk had
not this problem. Anyway better safe than sorry... Maybe related to Gradle
version or rather libs loaded?
The reason why the stable (and old) demos were not running is because the
EntitySaxReaderTests did not pass
The SOAP and HTTP engines are open doors to security issues.
At https://markmail.org/message/pgtjyh23bazq4s2w I proposed to comment them out
as we did for RMI in the past.
Of cause it must be clearly documented how to use them if needed.
Here is the email content:
After the recent fix for the CVE-2021-26295[1] we discussed with the security
team about the opportunity need to comment out the SOAP and HTTP engines
like we did in the past for RMI[2], this obviously for security reason.
[1] OFBIZ-12167 "Adds a blacklist (to be
renamed soon to denylist) in Java serialisation (CVE-2021-26295)"
[2] OFBIZ-6942 "Comment out RMI related
code because of the Java deserialization issue [CVE-2016-2170] "
I just put a small comment in webtools controller, it should be enough.
The tests pass
1. Navigate to URL: accounting/control/FindFinAccount
2. Click on Find button. List of fin account will be displayed.
3. Click on delete button near available balance column.
Thanks: Lalit Dashora for report, Sourabh Jain for the initial fix, Pawan Verma
for the defintive fix
Fixed: Mexican States Abbreviations
In GeoData_MX.xml abbreviations of the Mexican States were wrong and
"Mexico City" state was labeled as County, which is not.
In CommonUiLabels.xml and CommonEntityLabels.xml were added some missing values
to "es" and "es-MX" languages
In ServiceDemoData.xml were added the Mexican federal holidays under the
temporal expression "MX_FED_HOLIDAYS"
Thanks: Zottacko WallyMan
We have a lot of "do nothing" in Java code. In case of catch we should at least
have Debug.logError(e, MODULE); and maybe an explanation in the comment.
Fixes few javadoc issues
Since this has been ignored for few commits I need to increase
tasks.checkstyleMain.maxErrors from 12224 to 12247 (did not check the detail)