(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...
(OFBIZ-11470)
As reported by OWASP ZAP:
A cookie has been set without the SameSite attribute, which means that the
cookie can be sent as a result of a 'cross-site' request. The SameSite attribute
is an effective counter measure to cross-site request forgery, cross-site script
inclusion, and timing attacks.
The solution was not obvious in OFBiz for 2 reasons:
1. There is no HttpServletResponse::setHeader. So we need to use a filter
(SameSiteFilter) and even that is not enough because of 2:
2. To prevent session fixation we force Tomcat to generates a new jsessionId,
ultimately put in cookie, in LoginWorker::login. So we need to add a call to
SameSiteFilter::addSameSiteCookieAttribute in
UtilHttp::setResponseBrowserDefaultSecurityHeaders.
(OFBIZ-11426)
This problem came from when the GenericEntity try to store fields value on the map,
If the java type didn't match with the current value type, the function failed and
didn't try to convert it on the wanted type.
Thanks to Pawan Verma and Pierre Smits to raise this issue
ModelFormField#getCurrentContainerId rather than
ModelFormField#getIdName to ensure any FlexibleStringExpander expression
defined in the field's id-name property is processed before rendering
into the container FTL macro.
(OFBIZ-4035)
components
(OFBIZ-4956)
Currently there are some URLs present in application components with
auth="false". So anyone can hit these URLs and access these resources without
authorization.
I think all the URLs should be secure with auth="true"
jleroux: I have also fixed the dataResourceId="GZ-DIG"
Thanks: Amardeep Singh Jhajj for report and initial fix
(OFBIZ-11440)
During refactoring (OFBIZ-7113), the service reader used two different methods to read a
permission service definition if is present alone or in a group. For the alone version a link
was missing between the service and the permission service to resolve correctly the permission.
To solve this problem I reorganized to use only one method to initialize a service model permission.
Other point, an attribute renaming was missed : action -> permissionMainAction, when service permission call was called
Last, these problems weren't detected before due to missing unit test on failure service permission, now cover.
target parameters
(OFBIZ-11418)
Changed target-parameter attribute of the form widget's Lookup field to
use the FlexibleStringExpander type rather than String. This has been
done to allow reference to other form fields which may have had their
parameter-name attribute set to a FlexibleStringExpander expression.
(OFBIZ-10571)
Following refactoring done -
-- Refactored code to fall in line with some java standards.
-- Based on FindBugs suggestion, refactored some classes to have static nested classes instead of inner class.
Thanks Girish Vasmatkar for reporting the issue and providing the patch.
connection-locks
(OFBIZ-11312)
The method DatabaseUtil.getColumnInfo(...) uses an elaborate algorithm using a
List<Future<AbstractCountingCallable>> object. This does not work properly as it
runs into connection-locks. When debugging the error does not occur. I assume
that the slower pace of debugging prevents the error.
Thanks: Benjamin Jugl
Improved: no functional change
(OFBIZ-10837) (OFBIZ-11398)
Steps to generate:
1. Navigate to - catalog/control/EditProdCatalog?prodCatalogId=TestCatalog
2. Click on - CREATE SEO CATEGORY/PRODUCTS
3. The broken page will be displayed
The issue is due to the use of a GString in
createMissingCategoryAndProductAltUrls().
This:
result.successMessageList = [
"Categories updated: ${categoriesUpdated}",
"Products updated: ${productsUpdated}"
As it's common to use such expressions I have added the necessary
org.codehaus.groovy.runtime.GStringImpl groovy.lang.GString
to the white list of classes in listOfSafeObjectsForInputStream in
SafeObjectInputStream.properties
I finally have also decided to use this property as default and commented for
committers to be aware that it should be also put in DEFAULT_WHITELIST_PATTERN
in SafeObjectInputStream class. Because if, for a reason,
listOfSafeObjectsForInputStream is empty OFBiz will still be protected
Thanks: Dikpal Kanungo for reporting
form renderer from String to FlexibleStringExpander
(OFBIZ-4035)
Document that the id-name attribute for a form widget's field
element can use ${} notation. Also document the default value if id-name is
not set.
(OFBIZ-11407)
Overriding the new default property secretRequired to be not required
and added the default property "secret" in the commented out section.
(OFBIZ-11200)
Before this commit, to purge old job we use the thread job manager to check
if some job need to be run and if the pool is empty, check the old job to purge.
I detected a problem when you have many job's server and more than one pool.
When you have a first pool that run regular job and a second that receive
huge asynchrone services (by persist call), the server who manage the second pool
have rarely the possibility to purge their jobs that, by the way, increase JobSandbox table.
The Server who manage the first pool, call often the purge process, but the table size
generate a long query time to purge few element. Long query time, run often,
this purge process load uselessly the database.
After analyze, I refactoring these following items :
* When you call JobSandbox table for a purge, use a limit on the query
with the max thread pool because when you have the database return,
you purge only with this limit so this help the database to not scan
the whole table. Other small improvement, do not sort the result
(no functional gain).
* Purge by the pool thread is nice, each server can only purge their
own job (filtered on run_by_instance_id), to help an overloaded server,
I was rehability purgeOldJobs service that it can run with specific
parameter to make assistance.
* Last, all job services are historical on class org.apache.ofbiz.service.ServiceUtil,
I moved them all in a new dedicate class org.apache.ofbiz.service.job.JobServices
(OFBIZ-11396)
When using variable pattern with replaceFirst you may cross issues if the
pattern contains specific tokens. For instance on Windows with the path
"C:\projectsASF\Git\ofbiz-framework/" you have inside the token "\p" which has
a special meaning.
(OFBIZ-11396)
When using variable pattern with replaceFirst you may cross issues if the
pattern contains specific tokens. For instance on Windows with the path
"C:\projectsASF\Git\ofbiz-framework/" you have inside the token "\p" which has
a special meaning.
(OFBIZ-11158)
EntityQuery usage to perform data fetching is increasing, we should also add support for EntityQuery in ProgramExport feature.
Thanks: Devanshu Vyas for report and patch and Suraj Khurana, Nicolas Malin for the review.
(OFBIZ-11335)
The commit 1941a05a34 introduce the visualTheme
to generate a form with FactoryForm and forms present on FindGeneric has been forget
Thanks to Sebastian Berg for raise this issue
(OFBIZ-11335)
Currently on OFBiz we implemented a process to define some different
screen and menu that can be implemented by the theming.
But for the form we have nothing. All style are hard coded on each
<grid name="ListEntities" ...
odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
I extend the theming implementation principle to forms element with adding :
* a new xsd element common-forms (like common-screens)
* some default form templates to extend :
* grid CommonSimpleGrid
* grid CommonBasicGrid
* form CommonSimpleList
* form CommonBasicList
* form CommonInLineEditList
* form CommonBasicSingle
We can use its like :
<form name="LayoutDemoList" extends="CommonBasicList"
extends-resource="component://common/widget/CommonForms.xml"
The main difficulty raise to this task was propage the visualTheme during
the ModelForm intanciation, because we need to load wiget style
(and some other information wanted on the template) on model load in memory.
This is cover by commit 1941a05a34.
Forms present on the screen https://localhost:8443/webtools/control/WebtoolsLayoutDemo
are now extend through with theme.
Finally with this we can extend style form (pagination, header, line and so on ...)
directly by your theme without change the framework.