Author SHA1 Message Date
Jacques Le Roux 061252a80e 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-07-20 17:21:52 +02:00
Jacques Le Roux 929dddf0e6 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 12:25:58 +02:00
Pierre Smits 9d8a41d3e8 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:07:39 +02:00
Jacques Le Roux f627d97d14 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

Conflicts handled by hand
2022-04-14 15:48:38 +02:00
Jacques Le Roux 829e1ca535 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

Conflicts handled by hand
2022-04-13 14:46:18 +02:00
Benjamin Jugl fae9da9aa1 Fixed: Setting VIEW_INDEX to 0 in ForumScreens.xml when not initialized (OFBIZ-11429) 2022-02-22 23:02:59 +01:00
Jacques Le Roux 3e76bb7193 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:50:13 +01:00
10 changed files with 40 additions and 21 deletions
@@ -28,4 +28,5 @@ under the License.
<SecurityGroupPermission fromDate="2001-05-13 12:00:00.0" groupId="ASSETMAINTTECH" permissionId="ASSETMAINT_UPDATE"/>
<SecurityGroupPermission fromDate="2001-05-13 12:00:00.0" groupId="FULLADMIN" permissionId="ASSETMAINT_ADMIN"/>
<SecurityGroupPermission fromDate="2001-01-01 00:00:00.0" groupId="VIEWADMIN" permissionId="ASSETMAINT_VIEW"/>
</entity-engine-xml>
+2 -2
View File
@@ -60,7 +60,7 @@ under the License.
</entity-one>
<!-- parameters for the performFind service -->
<set field="parameters.forumId" from-field="parameters.forumId" default-value="${parameters.contentId}"/>
<set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer"/>
<set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer" default-value="0" />
<set field="viewSizeDefaultValue" value="${groovy: modelTheme.getDefaultViewSize()}" type="Integer"/>
<set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="${viewSizeDefaultValue}"/>
<entity-condition entity-name="ContentAssocViewTo" list="forumMessages" >
@@ -95,7 +95,7 @@ under the License.
<parameter param-name="forumId" from-field="parameters.forumId"/>
<parameter param-name="forumMessageIdTo" value=""/>
<parameter param-name="threadView" from-field="parameters.threadView"/>
<parameter param-name="VIEW_INDEX" from-field="parameters.VIEW_INDEX"/>
<parameter param-name="VIEW_INDEX" from-field="viewIndex"/>
</link>
</widgets>
</section>
+1
View File
@@ -206,6 +206,7 @@ under the License.
</drop-down>
</field>
<field name="exampleName" title="${uiLabelMap.FormFieldTitle_exampleName}" required-field="true"><text /></field>
<field name="exampleName" title="${uiLabelMap.FormFieldTitle_exampleName}" required-field="true" widget-style="required"><text placeholder="${uiLabelMap.FormFieldTitle_exampleName}"/></field>
<field name="description" title="${uiLabelMap.CommonDescription}"/>
<field name="longDescription" title="${uiLabelMap.ExampleLongDescription}"/>
<field name="anotherText">
+3 -3
View File
@@ -20,7 +20,7 @@ dependencies {
// 1. Remember to change the version LUCENE_VERSION in SearchWorker class when upgrading.
// 2. luceneMatchVersion should be updated in solrconfig.xml
// 3. Also Solr et Lucene should use the same version,
pluginLibsCompile 'org.apache.lucene:lucene-core:8.11.1'
pluginLibsCompile 'org.apache.lucene:lucene-queryparser:8.11.1'
pluginLibsCompile 'org.apache.lucene:lucene-analyzers-common:8.11.1'
pluginLibsCompile 'org.apache.lucene:lucene-core:8.11.2'
pluginLibsCompile 'org.apache.lucene:lucene-queryparser:8.11.2'
pluginLibsCompile 'org.apache.lucene:lucene-analyzers-common:8.11.2'
}
@@ -41,7 +41,7 @@ public final class SearchWorker {
public static final String module = SearchWorker.class.getName();
private static final Version LUCENE_VERSION = Version.LUCENE_8_11_1;
private static final Version LUCENE_VERSION = Version.LUCENE_8_11_2;
private SearchWorker() {}
+1 -1
View File
@@ -20,7 +20,7 @@ dependencies {
// 1. Remember to change the version LUCENE_VERSION in SearchWorker class when upgrading.
// 2. luceneMatchVersion should be updated in solrconfig.xml
// 3. Also Solr et Lucene should use the same version,
pluginLibsCompile 'org.apache.solr:solr-core:8.11.1'
pluginLibsCompile 'org.apache.solr:solr-core:8.11.2'
pluginLibsCompile 'com.google.guava:guava:28.0-jre'
}
+1 -1
View File
@@ -35,7 +35,7 @@
that you fully re-index after changing this setting as it can
affect both how text is indexed and queried.
-->
<luceneMatchVersion>8.11.1</luceneMatchVersion>
<luceneMatchVersion>8.11.2</luceneMatchVersion>
<!-- <lib/> directives can be used to instruct Solr to load any Jars
identified and use them to resolve any "plugins" specified in
@@ -78,7 +78,8 @@ public abstract class SolrProductSearch {
String solrIndexName = (String) context.get("indexName");
if (SolrUtil.isSolrEcaEnabled()) {
// Debug.logVerbose("Solr: addToSolr: Running indexing for productId '" + productId + "'", module);
System.setProperty("SolrDispatchFilter", "runsAfterControlFilter");
// Debug.logVerbose("Solr: addToSolr: Running indexing for productId '" + productId + "'", MODULE);
try {
GenericValue product = EntityQuery.use(delegator).from("Product").where("productId", productId).queryOne();
Map<String, Object> dispatchContext = ProductUtil.getProductContent(product, dctx, context);
@@ -109,6 +110,7 @@ public abstract class SolrProductSearch {
Debug.logError(e, e.getMessage(), module);
result = ServiceUtil.returnError(e.toString());
}
System.clearProperty("SolrDispatchFilter");
} else {
final String statusMsg = "Solr ECA indexing disabled; skipping indexing for productId '" + productId + "'";
if (Debug.verboseOn()) Debug.logVerbose("Solr: addToSolr: " + statusMsg, module);
@@ -20,10 +20,10 @@
package org.apache.ofbiz.solr.test;
import java.util.HashMap;
import java.util.Map;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.ofbiz.entity.GenericValue;
import org.apache.ofbiz.entity.util.EntityQuery;
@@ -75,11 +75,14 @@ public class SolrTests extends OFBizTestCase {
throw new Exception(errorMessage);
}
assertTrue("Could not query search index", ServiceUtil.isSuccess(sresp));
}
public void testAddToSolrIndex() throws Exception{
/**
* Test add to solr index.
* @throws Exception the exception
*/
public void testAddToSolrIndex() throws Exception {
System.setProperty("SolrDispatchFilter", "runsAfterControlFilter");
context = new HashMap<>();
context.put("productId", validTestProductId);
response = dispatcher.runSync("addToSolrIndex", context);
@@ -89,9 +92,15 @@ public class SolrTests extends OFBizTestCase {
}
assertTrue("Could not add Product to Index", ServiceUtil.isSuccess(
response));
System.clearProperty("SolrDispatchFilter");
}
public void testAddToSolrIndex_invalidProduct() throws Exception {
/**
* Test add to solr index invalid product.
* @throws Exception the exception
*/
public void testAddToSolrIndexInvalidProduct() throws Exception {
System.setProperty("SolrDispatchFilter", "runsAfterControlFilter");
context = new HashMap<>();
context.put("productId", invalidTestProductId);
response = dispatcher.runSync("addToSolrIndex", context);
@@ -101,9 +110,11 @@ public class SolrTests extends OFBizTestCase {
}
assertTrue("Could not test the addition of an invalid product to the Solr index", ServiceUtil.isSuccess(
response));
System.clearProperty("SolrDispatchFilter");
}
public void testAddListToSolrIndex() throws Exception {
System.setProperty("SolrDispatchFilter", "runsAfterControlFilter");
List<Map<String, Object>> products = new ArrayList<>();
Map<String, Object> product_1 = new HashMap<>();
Map<String, Object> product_2 = new HashMap<>();
@@ -124,10 +135,15 @@ public class SolrTests extends OFBizTestCase {
throw new Exception(errorMessage);
}
assertTrue("Could not add products to index", ServiceUtil.isSuccess(response));
System.clearProperty("SolrDispatchFilter");
}
public void testAddListToSolrIndex_invalidProducts() throws Exception {
/**
* Test add list to solr index invalid products.
* @throws Exception the exception
*/
public void testAddListToSolrIndexInvalidProducts() throws Exception {
System.setProperty("SolrDispatchFilter", "runsAfterControlFilter");
List<Map<String, Object>> products = new ArrayList<>();
Map<String, Object> product_1 = new HashMap<>();
Map<String, Object> product_2 = new HashMap<>();
@@ -151,7 +167,7 @@ public class SolrTests extends OFBizTestCase {
throw new Exception(errorMessage);
}
assertTrue("Could not test adding invalid products to index", ServiceUtil.isSuccess(response));
System.clearProperty("SolrDispatchFilter");
}
}
@@ -66,9 +66,8 @@ public class OFBizSolrContextFilter extends SolrDispatchFilter {
*/
public void init(FilterConfig config) throws ServletException {
Properties props = System.getProperties();
props.setProperty("solr.log.dir", UtilProperties.getPropertyValue("solrconfig", "solr.log.dir", "runtime/logs/solr"));
props.setProperty("solr.log.level", UtilProperties.getPropertyValue("solrconfig", "solr.log.level", "INFO"));
props.setProperty("solr/home", UtilProperties.getPropertyValue("solrconfig", "solr/home"));
String ofbizHome = (String) props.get("ofbiz.home");
config.getServletContext().setAttribute(SOLRHOME_ATTRIBUTE, ofbizHome + props.getProperty("solr/home"));
super.init(config);
}