Issue in rendering Freemarker Template from String.
--------------------------------------------------- Key: OFBIZ-3782 URL: https://issues.apache.org/jira/browse/OFBIZ-3782 Project: OFBiz Issue Type: Bug Components: framework Reporter: Sumit Pandit Priority: Minor Hi All, I am getting an issue in rendering dataresource record when I tried to update the contents on the fly. Text is rendering via <@renderContentAsText contentId="${contentId}" ignoreTemplate="true"/>. While rendering updated record, in turn FreeMarkerWorker.renderTemplateFromString() method is being called. Here in this method, variable 'templateString' contains updated text while cachedTemplates.get(templateLocation) returns template of previous record from cache. So as a result 'if' condition fails and previous template rendered wothout showing changes in it. So to resolve it, I would suggest to modify the method by compare 'templateString' value with 'template''s value. where if both are not same then create a new template with 'templateString''s value and put it in cache. I am going to attach patch for this shortly. -- Thanks And Regards Sumit Pandit -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
[ https://issues.apache.org/jira/browse/OFBIZ-3782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sumit Pandit updated OFBIZ-3782: -------------------------------- Attachment: OFBIZ-3782.patch Please find attached patch for above > Issue in rendering Freemarker Template from String. > --------------------------------------------------- > > Key: OFBIZ-3782 > URL: https://issues.apache.org/jira/browse/OFBIZ-3782 > Project: OFBiz > Issue Type: Bug > Components: framework > Reporter: Sumit Pandit > Priority: Minor > Attachments: OFBIZ-3782.patch > > > Hi All, > I am getting an issue in rendering dataresource record when I tried to update the contents on the fly. > Text is rendering via <@renderContentAsText contentId="${contentId}" ignoreTemplate="true"/>. > While rendering updated record, in turn FreeMarkerWorker.renderTemplateFromString() method is being called. > Here in this method, variable 'templateString' contains updated text while cachedTemplates.get(templateLocation) returns template of previous record from cache. So as a result 'if' condition fails and previous template rendered wothout showing changes in it. > So to resolve it, I would suggest to modify the method by compare 'templateString' value with 'template''s value. where if both are not same then create a new template with 'templateString''s value and put it in cache. > I am going to attach patch for this shortly. > -- > Thanks And Regards > Sumit Pandit -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12871618#action_12871618 ] Sumit Pandit commented on OFBIZ-3782: ------------------------------------- There is an issue in attached patch, I would attached a new one shortly. Thanks to Bob Morley for notifying it. > Issue in rendering Freemarker Template from String. > --------------------------------------------------- > > Key: OFBIZ-3782 > URL: https://issues.apache.org/jira/browse/OFBIZ-3782 > Project: OFBiz > Issue Type: Bug > Components: framework > Reporter: Sumit Pandit > Priority: Minor > Attachments: OFBIZ-3782.patch > > > Hi All, > I am getting an issue in rendering dataresource record when I tried to update the contents on the fly. > Text is rendering via <@renderContentAsText contentId="${contentId}" ignoreTemplate="true"/>. > While rendering updated record, in turn FreeMarkerWorker.renderTemplateFromString() method is being called. > Here in this method, variable 'templateString' contains updated text while cachedTemplates.get(templateLocation) returns template of previous record from cache. So as a result 'if' condition fails and previous template rendered wothout showing changes in it. > So to resolve it, I would suggest to modify the method by compare 'templateString' value with 'template''s value. where if both are not same then create a new template with 'templateString''s value and put it in cache. > I am going to attach patch for this shortly. > -- > Thanks And Regards > Sumit Pandit -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sumit Pandit updated OFBIZ-3782: -------------------------------- Attachment: OFBIZ-3782.patch Here is updated patch, thanks to Bob for help. > Issue in rendering Freemarker Template from String. > --------------------------------------------------- > > Key: OFBIZ-3782 > URL: https://issues.apache.org/jira/browse/OFBIZ-3782 > Project: OFBiz > Issue Type: Bug > Components: framework > Reporter: Sumit Pandit > Priority: Minor > Attachments: OFBIZ-3782.patch, OFBIZ-3782.patch > > > Hi All, > I am getting an issue in rendering dataresource record when I tried to update the contents on the fly. > Text is rendering via <@renderContentAsText contentId="${contentId}" ignoreTemplate="true"/>. > While rendering updated record, in turn FreeMarkerWorker.renderTemplateFromString() method is being called. > Here in this method, variable 'templateString' contains updated text while cachedTemplates.get(templateLocation) returns template of previous record from cache. So as a result 'if' condition fails and previous template rendered wothout showing changes in it. > So to resolve it, I would suggest to modify the method by compare 'templateString' value with 'template''s value. where if both are not same then create a new template with 'templateString''s value and put it in cache. > I am going to attach patch for this shortly. > -- > Thanks And Regards > Sumit Pandit -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3782?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacques Le Roux closed OFBIZ-3782. ---------------------------------- Assignee: Jacques Le Roux Fix Version/s: Release Branch 09.04 Release Branch 10.04 SVN trunk Resolution: Fixed Thanks Sumit (and Bob), Your patch is in trunl at r950866, R10.04 at r950867, R9.04 at r950868 > Issue in rendering Freemarker Template from String. > --------------------------------------------------- > > Key: OFBIZ-3782 > URL: https://issues.apache.org/jira/browse/OFBIZ-3782 > Project: OFBiz > Issue Type: Bug > Components: framework > Reporter: Sumit Pandit > Assignee: Jacques Le Roux > Priority: Minor > Fix For: Release Branch 09.04, Release Branch 10.04, SVN trunk > > Attachments: OFBIZ-3782.patch, OFBIZ-3782.patch > > > Hi All, > I am getting an issue in rendering dataresource record when I tried to update the contents on the fly. > Text is rendering via <@renderContentAsText contentId="${contentId}" ignoreTemplate="true"/>. > While rendering updated record, in turn FreeMarkerWorker.renderTemplateFromString() method is being called. > Here in this method, variable 'templateString' contains updated text while cachedTemplates.get(templateLocation) returns template of previous record from cache. So as a result 'if' condition fails and previous template rendered wothout showing changes in it. > So to resolve it, I would suggest to modify the method by compare 'templateString' value with 'template''s value. where if both are not same then create a new template with 'templateString''s value and put it in cache. > I am going to attach patch for this shortly. > -- > Thanks And Regards > Sumit Pandit -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-3782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12875080#action_12875080 ] Sumit Pandit commented on OFBIZ-3782: ------------------------------------- Thanks Jacques. > Issue in rendering Freemarker Template from String. > --------------------------------------------------- > > Key: OFBIZ-3782 > URL: https://issues.apache.org/jira/browse/OFBIZ-3782 > Project: OFBiz > Issue Type: Bug > Components: framework > Reporter: Sumit Pandit > Assignee: Jacques Le Roux > Priority: Minor > Fix For: Release Branch 09.04, Release Branch 10.04, SVN trunk > > Attachments: OFBIZ-3782.patch, OFBIZ-3782.patch > > > Hi All, > I am getting an issue in rendering dataresource record when I tried to update the contents on the fly. > Text is rendering via <@renderContentAsText contentId="${contentId}" ignoreTemplate="true"/>. > While rendering updated record, in turn FreeMarkerWorker.renderTemplateFromString() method is being called. > Here in this method, variable 'templateString' contains updated text while cachedTemplates.get(templateLocation) returns template of previous record from cache. So as a result 'if' condition fails and previous template rendered wothout showing changes in it. > So to resolve it, I would suggest to modify the method by compare 'templateString' value with 'template''s value. where if both are not same then create a new template with 'templateString''s value and put it in cache. > I am going to attach patch for this shortly. > -- > Thanks And Regards > Sumit Pandit -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
Free forum by Nabble | Edit this page |