This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/trunk by this push:
     new d20b0fd07e Improved: Align survey template location resolution with 
other widget/template loaders (#1730)
d20b0fd07e is described below

commit d20b0fd07e6387b5318f78d446458d3644a839ac
Author: Krishna Uprit <[email protected]>
AuthorDate: Tue Aug 25 17:03:45 2026 +0530

    Improved: Align survey template location resolution with other 
widget/template loaders (#1730)
    
    - SurveyWrapper currently resolves its template location on its own,
    separately from the other widget/template loaders in the codebase
    (screens, forms, grids, menus, themes).
    
    - This change updates SurveyWrapper.render(String) to resolve its
    template location the same way those other loaders already do, so
    resolution is consistent across all loaders in the framework.
    
    Thank you Krishna Uprit for the contribution.
    
    Co-authored-by: Krishnauprit18 <[email protected]>
---
 .../src/main/java/org/apache/ofbiz/content/survey/SurveyWrapper.java | 5 +++++
 1 file changed, 5 insertions(+)

diff --git 
a/applications/content/src/main/java/org/apache/ofbiz/content/survey/SurveyWrapper.java
 
b/applications/content/src/main/java/org/apache/ofbiz/content/survey/SurveyWrapper.java
index 314e095a9c..565b69827a 100644
--- 
a/applications/content/src/main/java/org/apache/ofbiz/content/survey/SurveyWrapper.java
+++ 
b/applications/content/src/main/java/org/apache/ofbiz/content/survey/SurveyWrapper.java
@@ -175,6 +175,11 @@ public class SurveyWrapper {
      * @throws SurveyWrapperException
      */
     public Writer render(String templatePath) throws SurveyWrapperException {
+        if 
(UtilValidate.isUrlInStringAndDoesNotStartByComponentProtocol(templatePath)) {
+            String errMsg = "Problem getting the template for Survey from URL: 
" + templatePath;
+            Debug.logError(errMsg, MODULE);
+            throw new IllegalArgumentException(errMsg);
+        }
         URL templateUrl = null;
         try {
             templateUrl = FlexibleLocation.resolveLocation(templatePath);

Reply via email to