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
The following commit(s) were added to refs/heads/release18.12 by this push:
new 21fe52906a Fixed: Content tag in a screen does not display correctly
images (OFBIZ-12685)
21fe52906a is described below
commit 21fe52906ae1a0cf8677699d8e0893258dbcbecf
Author: Jacques Le Roux <[email protected]>
AuthorDate: Sun Aug 28 17:57:56 2022 +0200
Fixed: Content tag in a screen does not display correctly images
(OFBIZ-12685)
When we want to display an image content within a screen through <content/>
tag,
images are not rendered correctly
To test:
Go to admin party profile page and upload a picture file as a new
"LGOIMGURL"
for instance:
https://localhost:8443/partymgr/control/viewprofile?partyId=admin
When your content file is uploaded, note the contentId and got to page
ShowContent (which render content using the tag <content />)
https://localhost:8443/content/control/showContent?contentId=XXXXX
The image will not be rendered without the given patch.
jleroux: since it's eventually negated, it makes no sense to test if the
content is either an image or an application. It can't be both. This is a
very
old feature (pre-apache era) that seems to have never been tested/used
I have made a formatting change and added a comment to explain.
Thanks: Leila Mekika
---
.../main/java/org/apache/ofbiz/widget/model/ModelScreenWidget.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelScreenWidget.java
b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelScreenWidget.java
index 4f913c5cdf..c0ec6a842c 100644
---
a/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelScreenWidget.java
+++
b/framework/widget/src/main/java/org/apache/ofbiz/widget/model/ModelScreenWidget.java
@@ -1428,8 +1428,8 @@ public abstract class ModelScreenWidget extends
ModelWidget {
mimeTypeId = content.getString("mimeTypeId");
}
- if (!(mimeTypeId != null
- && ((mimeTypeId.indexOf("application") >= 0) ||
(mimeTypeId.indexOf("image")) >= 0))) {
+ // This is to render an image only, not an application document
+ if (!(mimeTypeId != null && mimeTypeId.indexOf("application")
>= 0)) {
screenStringRenderer.renderContentBegin(writer, context,
this);
screenStringRenderer.renderContentBody(writer, context,
this);
screenStringRenderer.renderContentEnd(writer, context,
this);