[ofbiz-framework] branch release18.12 updated (55119ef -> c7a81db)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] branch release18.12 updated (55119ef -> c7a81db)

jleroux@apache.org
This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a change to branch release18.12
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git.


    from 55119ef  Fixed: Incorrect value in entity-auto invoke for removeProductFeatureDataResource. (OFBIZ-11614)
     new f2191b2  Fixed: PartyProfileContent.js does not work
     new c7a81db  Improved: Improve ObjectInputStream class

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 applications/party/template/party/profileblocks/Content.ftl | 13 ++++++++++++-
 .../org/apache/ofbiz/base/util/SafeObjectInputStream.java   |  4 ++++
 .../main/java/org/apache/ofbiz/base/util/UtilObject.java    |  4 ++++
 .../org/apache/ofbiz/webapp/control/RequestHandler.java     |  4 ----
 4 files changed, 20 insertions(+), 5 deletions(-)

Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] 01/02: Fixed: PartyProfileContent.js does not work

jleroux@apache.org
This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch release18.12
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git

commit f2191b2115b521e77557f97f1b7c42bfbea0f50b
Author: Jacques Le Roux <[hidden email]>
AuthorDate: Sat May 2 09:31:41 2020 +0200

    Fixed: PartyProfileContent.js does not work
   
    (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
   
    Conflicts
    removed framework/common/groovyScripts/CommonServices.groovy
---
 applications/party/template/party/profileblocks/Content.ftl | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/applications/party/template/party/profileblocks/Content.ftl b/applications/party/template/party/profileblocks/Content.ftl
index b3633df..72bdb53 100644
--- a/applications/party/template/party/profileblocks/Content.ftl
+++ b/applications/party/template/party/profileblocks/Content.ftl
@@ -54,5 +54,16 @@ under the License.
         </select>
         <input type="submit" value="${uiLabelMap.CommonUpload}" />
       </form>
+      <div id='progress_bar'><div></div></div>
     </div>
-  </div>
\ No newline at end of file
+  </div>
+  <script type="application/javascript">
+    jQuery("#uploadPartyContent").validate({
+        submitHandler: function(form) {
+            <#-- call upload scripts - functions defined in PartyProfileContent.js -->
+            uploadPartyContent();
+            getUploadProgressStatus();
+            form.submit();
+        }
+    });
+  </script>

Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] 02/02: Improved: Improve ObjectInputStream class

jleroux@apache.org
In reply to this post by jleroux@apache.org
This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch release18.12
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git

commit c7a81dbc6b9d0fa0d7e4deb458cedacbe5486cdb
Author: Jacques Le Roux <[hidden email]>
AuthorDate: Sat May 2 12:32:07 2020 +0200

    Improved: Improve ObjectInputStream class
   
    (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.
---
 .../main/java/org/apache/ofbiz/base/util/SafeObjectInputStream.java   | 4 ++++
 .../base/src/main/java/org/apache/ofbiz/base/util/UtilObject.java     | 4 ++++
 .../src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java | 4 ----
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/SafeObjectInputStream.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/SafeObjectInputStream.java
index 2aebcde..d50cfbf 100644
--- a/framework/base/src/main/java/org/apache/ofbiz/base/util/SafeObjectInputStream.java
+++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/SafeObjectInputStream.java
@@ -64,6 +64,10 @@ public final class SafeObjectInputStream extends ObjectInputStream {
     @Override
     protected Class<?> resolveClass(ObjectStreamClass classDesc) throws IOException, ClassNotFoundException {
         if (!whitelistPattern.matcher(classDesc.getName()).find()) {
+            // DiskFileItem, FileItemHeadersImpl are not serializable.
+            if (classDesc.getName().contains("org.apache.commons.fileupload")) {
+                return null;
+            }
             Debug.logWarning("***Incompatible class***: "
                     + classDesc.getName()
                     + ". Please see OFBIZ-10837.  Report to dev ML if you use OFBiz without changes. "
diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilObject.java b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilObject.java
index eb7666a..e194a2c 100644
--- a/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilObject.java
+++ b/framework/base/src/main/java/org/apache/ofbiz/base/util/UtilObject.java
@@ -93,6 +93,10 @@ public final class UtilObject {
         Object obj = null;
         try {
             obj = getObjectException(bytes);
+            // DiskFileItem, FileItemHeadersImpl are not serializable. So SafeObjectInputStream::resolveClass return null
+            if (obj == null) {
+                return null;
+            }
         } catch (ClassNotFoundException | IOException e) {
             Debug.logError(e, module);
         }
diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java
index 3e9d24e..41b5d44 100644
--- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java
+++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java
@@ -903,10 +903,6 @@ public class RequestHandler {
             }
         }
         if (reqAttrMap.size() > 0) {
-            // fileItems is not serializable.
-            // It contains a temporary DiskFileItem with a null value than can't be detected by UtilMisc::makeMapSerializable
-            // So it must be removed from reqAttrMap. See OFBIZ-11534
-            reqAttrMap.remove("fileItems");
             byte[] reqAttrMapBytes = UtilObject.getBytes(reqAttrMap);
             if (reqAttrMapBytes != null) {
                 req.getSession().setAttribute("_REQ_ATTR_MAP_", StringUtil.toHexString(reqAttrMapBytes));