(OFBIZ-11643)
When doing OFBIZ-6849 I forgot to take care of the https attribute of the
security element used in controllers.
It's not used anymore since we used HTTPS everywhere but in request listed in
http.request-map.list property of url.properties. It's even enforced by HSTS for
requests that are not listed in this property.
This removes the https attribute and removes its usage in in controllers.
(OFBIZ-10837)
While working on OFBIZ-11633 I crossed an issue in R18 (not in trunk) where
objects from org.apache.commons.fileupload (namely DiskFileItem and
FileItemHeadersImpl) are not serializable.
While at it I decided to handle at the SafeObjectInputStream level
the "fileItems" case I already crossed with, OFBIZ-11534, in RequestHandler
It has an inconvenient in R18 (not in trunk) where ObjectInputStream can't
handle a null class (of course) and so return a benign exception in log (only).
I believe it's better to handle these specific cases at the lower possible
level in all supported branches.
(OFBIZ-11633)
When you upload a content from the party profile page you don't see a progress
bar. The PartyProfileContent.js is loaded but for some reason is unused or wrong
Mohammad Kathawala mentionned that it was removed with OFBIZ-9299
It was also broken with OFBIZ-11402
Thanks: Mohammad for the track
(OFBIZ-11593)
The "entity/list" request has been put in with OFBIZ-11007. It's used to call
the entitymaint view and so is a demo/didactic duplicate of entitymaint request.
It's only used in FindGeneric screen (look for WebtoolsBackToEntityList label).
It's problematic because since the CSRF token defense was put in you can no
longer filter the entities from the entities list screen, even when the default
NoCsrfDefenseStrategy is used. It works if you use the entitymaint request
instead.
2020-01-19 I proposed in OFBIZ-11306 a solution for such cases.
It was not used because 2020-02-14 I thought it was no longer needed.
It was necessary for this case and implemented with commit e487122.
But as, Rohit Koushal reported, it breaks some functionalities like adding
address/update address during Quick Finalize Order. The issue can also be
reproduced in ecommerce when trying the same while checking out, or quick
checking out, an order.
More generally the error is of this kind:
|27.0.0.1-8009-exec-3 |ControlServlet |E| Error in request handler:
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.LinkedList.checkElementIndex(LinkedList.java:555) ~[?:1.8.0_252]
at java.util.LinkedList.get(LinkedList.java:476) ~[?:1.8.0_252]
at org.apache.ofbiz.webapp.control.RequestHandler.getRequestUri(RequestHandler.java:837) ~[main/:?]
and happens with URLs like
updateCheckoutOptions/editcontactmech?DONE_PAGE=checkoutoptions&contactMechId=9015
or
updateCheckoutOptions/editcontactmech?preContactMechTypeId=POSTAL_ADDRESS&
contactMechPurposeTypeId=SHIPPING_LOCATION&DONE_PAGE=checkoutoptions
So I decided to revert the concerned part of commit e487122 and to rather use
entitymaint instead of "entity/list" request.
(OFBIZ-11573)
More details: Method getColumnLabel returns the designated column's suggested title for use in printouts and displays. Method getColumnName returns the designated column's name.
Thanks: Suraj and Jacques for the review.
(OFBIZ-11606)
Fixes "<**:condition" not well managed and generating an error
Changes all the getNodeName() by getLocalName() in the ModelX****Condition.java
Thanks: Olivier
(OFBIZ-11606)
rootElement is not correct for a compound file, it's necessary to do a
UtilXml.firstChildElement(rootElement, "forms"); to be correct.
It's done for screen, form but not for grid !
So correction is now added the correct read of rootElement.
Thanks: Olivier
(OFBIZ-11609)
Fixes the if(test): toString() is not the same than getCanonicalName()
Also while at it, in case of exception, uses NoCsrfDefenseStrategy as default
(OFBIZ-)
After the VM demos crash yesterday, I had a look at the log of trunk demo and
found a lot of recurring errors block due to CsrfUtil::generateTokenForNonAjax.
It's not a big deal but it's annoying to have such useless errors cluttering the
logs
(OFBIZ-11598)
The http.upload.max.sizethreshold size is curently sets to 10240 (10KB) and that
seems small nowadays to me. We could use 1MB.
Also moves mail.spam.name in its mail block
Thanks: Pawan for review
* Improved: Added support to consider non-default transaction timeout for Groovy and Simple event handlers.(OFBIZ-11607)
* Revert "Improved: Added support to consider non-default transaction timeout for Groovy and Simple event handlers.(OFBIZ-11607)"
This reverts commit 934eaa4539.
* Improved: Added support to consider non-default transaction timeout for Groovy and Simple event handlers.(OFBIZ-11607)
Co-authored-by: Ravi Lodhi <lodhiravi1@gmail.com>
(OFBIZ-11534)
There is an issue in uploading large files, I am able to upload files up to 2 GB
successfully but getting an error when trying to upload a file larger than 2GB.
Example -
1. Go to party profile -
https://demo-trunk.ofbiz.apache.org/partymgr/control/viewprofile?partyId=admin
2. Try to create a party content with a file larger than 2 GB
3. Error on console
jleroux:
For a 2GB+ file you need to set Xmx to more than the double of the file size,
eg: gradlew ofbiz -PjvmArgs="-Xms1024M -Xmx5048M"
You then get another small issue (only in log) when redirecting to send the
partyId parameter.
This is because, DiskFileItem is a temporary Object with a null value contained
in "fileItems" attribute. It can't be detected by UtilMisc::makeMapSerializable
and that makes "fileItems" not serializable. So it must be removed from
reqAttrMap.
Thanks: Chandan Khandelwal for report, Michael for suggesting a very large file
to upload
SystemProperties
(OFBIZ-11594)(OFBIZ-11470)
After adding more latitude to set same site by using
EntityUtilProperties::getPropertyValueFromDelegatorName for retrieving the value
possibly from the DB as a SystemProperty, adds the value as strict in
SSOJWTDemoData.xml
(OFBIZ-11590)
This is due to OFBIZ-11402. Handling a converter for java.time.ZoneRegion is
complicated. Adding a toString() is enough.
Also 2 automated formatting while at it...
SystemProperties
(OFBIZ-11594)
Adds more latitude to set same site by using
EntityUtilProperties::getPropertyValueFromDelegatorName for retrieving the value
possibly from the DB as a SystemProperty.
OF course this would not work with tenants, but I doubt the "internal" SSO
feature will ever be use in a tenants context
SystemProperties
(OFBIZ-11594)
This comes handy when testing, from examples component, the internal SSO feature
which allows a token based login between OFBiz instances
The SSOJWTDemoData.xml inadvertently slipped in w/ previous commit
(OFBIZ-11593)
The FilterEntities widget form is also an issue because it's a POST form and
"entity/list" request use the GET method. Using "entitymaint" as target works
(POST by default)
(OFBIZ-11593)
The "entity/list" request has been put in with OFBIZ-11007. It's used to call
the entitymaint view and so is a demo/didactic duplicate of entitymaint request.
It's only used in FindGeneric screen (look for WebtoolsBackToEntityList label).
It's problematic because since the CSRF token defense was put in you can no
longer filter the entities from the entities list screen, even when the default
NoCsrfDefenseStrategy is used. It works if you use the entitymaint request
instead.
Anyway, 2020-01-19 I proposed in OFBIZ-11306 a solution for such cases.
It was not used because 2020-02-14 I thought it was no longer needed,
but it's necessary for this case, and maybe others not already detected.
Here it's implementation (only trunk)
Never ever install Eclipse Checkstyle plugin. It does not use the same version
than Gradle, it's then a mess (Eclipse's is newer).
Fixes issues in CsrfUtilTests.java
Mostly manually-automated, so some changes are not perfect. I have manually
changed back excessive ones
Comments out ArrayTypeStyle checkstyle
Updates checkstyleMain.maxErrors
(OFBIZ-11306)
Simple strategy is to rely on SameSite 'strict' value in SameSiteFilter in all
supported branches. No backport needed with the changes here.
Thanks: James for all the good work we did together :)
(OFBIZ-11246)
It seems that same request can not be parsed multiple times if it has multi part
object in it as the parse method remove it after that.
Found one stackoverflow link around the same:
https://stackoverflow.com/questions/13881272/
servletfileuploadparserequestrequest-returns-an-empty-list
I believe that all places/uploads using this workflow should resulting the same
issue.
One possible solution I could think of without going with new approach is to set
list of file Items into the request attribute and use it if parse method remove
it and unable to retrieve on 2nd call.
Thanks: Ankush Upadhyay for the analysis and initial patch. I only slightly
modified it.
(OFBIZ-11477)
According to OWASP OFBiz Web Content Caching is weak:
Independently of the cache policy defined by the web application, if caching web
application contents is allowed, the session IDs must never be cached, so it is
highly recommended to use the Cache-Control: no-cache="Set-Cookie, Set-Cookie2"
directive, to allow web clients to cache everything except the session ID
I though noticed that Set-Cookie2 is deprecated for a long time now. And we new
browsers policies it to often updated. So no need to use Set-Cookie2.
* Fixed: Specified key was too long; max key length is 767 bytes for ProductPromoCodeEmail entity.
(OFBIZ-5426)
The problem is in the entity model. An email address should not be used in the primary key - mainly because an email address is case-insensitive. A better design would be to use the email address contact mechanism ID in the primary key.
Done Following:
1. Changed Entity Name from ProductPromoCodeEmail to ProductPromoCodeContMech
2. Related Changes for the entity name change
3. Migration service to migrate old data
Thanks, Leon for the report and Adrian Crum, Jacques Le Roux, Ingo Wolfmayr, Deepak Dixit, Pierre Smits and Gil Portenseigne for the discussion and review.
* Improved: Added new line in service definition file and lincence in MigrationServices file.
(OFBIZ-5426)
Thanks, Jacopo for the review.
rendered using ids from ModelFormField#getCurrentContainerId.
(OFBIZ-4035)
Fixes an issue due to Eclipse automated import organisation.
There are still check style errors
rendered using ids from ModelFormField#getCurrentContainerId.
(OFBIZ-4035)
Fixes a check issue (line too long)
Notice: on Windows I get 20 errors when compiling:
> Task :compileTestJava FAILED
C:\projectsASF\Git\ofbiz-framework\framework\widget\src\test\java\org\apache\
ofbiz\widget\renderer\macro\MacroFormRendererTest.java:134:
error: annotation type not applicable to this kind of declaration
@Mock
^
I guess the change in build.gradle are not enough for Windows, to be seen later...