[ofbiz-framework] branch release18.12 updated: Fixed: Hyperlink title under form widget doesn't support character encoding for special characters (OFBIZ-12026)

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

[ofbiz-framework] branch release18.12 updated: Fixed: Hyperlink title under form widget doesn't support character encoding for special characters (OFBIZ-12026)

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


The following commit(s) were added to refs/heads/release18.12 by this push:
     new 2c4824f  Fixed: Hyperlink title under form widget doesn't support character encoding for special characters (OFBIZ-12026)
2c4824f is described below

commit 2c4824f9fa8b11b1ca3d2aa50a3c564feec6fd3d
Author: Jacques Le Roux <[hidden email]>
AuthorDate: Fri Dec 11 13:40:53 2020 +0100

    Fixed: Hyperlink title under form widget doesn't support character encoding for special characters (OFBIZ-12026)
   
    When we use any title with special characters for hyperlink tag, it shows broken
    string on UI, eg:
    <hyperlink description="${uiLabelMap.CommonImportExport}"  target="ImportExport">
    should render a button with the title "Import/Export. But it shows as
    Import&#x2f;Export
   
    jleroux: I have noticed that the same happens with special French characters.
    So it's a general issue.
    The title (description in code) is HTML encoded and that does not work for
    special characters. I simply used a string encoder.
   
    Thanks: Pradeep Choudhary for report, Sourabh Jain for a possible but not
    general solution at OFBIZ-12023, ie using target-type="plain"
---
 applications/accounting/widget/GlSetupForms.xml                       | 4 ++--
 .../org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java     | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/applications/accounting/widget/GlSetupForms.xml b/applications/accounting/widget/GlSetupForms.xml
index 7633f4b..439e628 100644
--- a/applications/accounting/widget/GlSetupForms.xml
+++ b/applications/accounting/widget/GlSetupForms.xml
@@ -30,7 +30,7 @@ under the License.
             </hyperlink>
         </field>
         <field name="accounting" title=" " use-when="hasBasicPermission" widget-style="buttontext">
-            <hyperlink description="${uiLabelMap.AccountingAccounting}" target="PartyAccountsSummary" target-type="plain">
+            <hyperlink description="${uiLabelMap.AccountingAccounting}" target="PartyAccountsSummary">
                 <parameter param-name="organizationPartyId" from-field="partyId"/>
             </hyperlink>
         </field>
@@ -40,7 +40,7 @@ under the License.
             </hyperlink>
         </field>
         <field name="importexport" title=" " use-when="hasBasicPermission" widget-style="buttontext">
-            <hyperlink description="${uiLabelMap.CommonImportExport}" target="ImportExport" target-type="plain">
+            <hyperlink description="${uiLabelMap.CommonImportExport}" target="ImportExport">
                 <parameter param-name="organizationPartyId" from-field="partyId"/>
             </hyperlink>
         </field>
diff --git a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java
index 445bac9..01a517d 100644
--- a/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java
+++ b/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java
@@ -3120,7 +3120,7 @@ public final class MacroFormRenderer implements FormStringRenderer {
     public void makeHyperlinkByType(Appendable writer, String linkType, String linkStyle, String targetType, String target, Map<String, String> parameterMap, String description, String targetWindow, String confirmation, ModelFormField modelFormField, HttpServletRequest request,
             HttpServletResponse response, Map<String, Object> context) throws IOException {
         String realLinkType = WidgetWorker.determineAutoLinkType(linkType, target, targetType, request);
-        String encodedDescription = encode(description, modelFormField, context);
+        String encodedDescription = internalEncoder.encode(description);
         // get the parameterized pagination index and size fields
         int paginatorNumber = WidgetWorker.getPaginatorNumber(context);
         ModelForm modelForm = modelFormField.getModelForm();