cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to remove a populator added to modifyPopulatorList in OOTB code

0 Likes
2,771

Hi experts,

When trying to remove a populator which has been added by modifyPopulatorList, its not working. In an ootb spring .xml, we have the below configuration. Now I would like to remove the searchResultSubscriptionProductPopulator from the converter list. How can I achieve this. We do not want this populator to be called. Please help here.

 <bean parent="modifyPopulatorList">
         <property name="list" ref="commerceSearchResultProductConverter"/>
         <property name="add" ref="searchResultSubscriptionProductPopulator"/>
     </bean>



Accepted Solutions (1)

Accepted Solutions (1)

arvind-kumar_avinash
Active Contributor
0 Likes

Hi - the following configuration should work:

 <!-- Remove the searchResultSubscriptionProductPopulator from the commerceSearchResultProductConverter -->    
 <bean parent="modifyPopulatorList">
     <property name="list" ref="commerceSearchResultProductConverter"/>
     <property name="remove" ref="searchResultSubscriptionProductPopulator"/>
 </bean>

Please check hybris/bin/platform/ext/platformservices/resources/platformservices/test/modify-populators-test-spring.xml for examples. You can also try executing ModifyPopulatorListBeanPostProcessorTest.java to test it.

0 Likes

Thanks for the reply.. But I am not supposed to change the OOTB spring.xml right?.. thinking of having this remove code snip in my custom facades-spring.xml.. SHould it suffice ?

arvind-kumar_avinash
Active Contributor
0 Likes

You don't have to change the OOTB spring.xml. You have to declare it in your custom spring.xml.

0 Likes

Thank you.. This worked.

I have one doubt here. So is there any fucntionality in OOTB that is making use of the subscriptionPopulator I just removed from the converter list.. We are not using it in our custom functionality anywhere.

arvind-kumar_avinash
Active Contributor
0 Likes

You are most welcome. I will get back to you regarding your new question.

Answers (1)

Answers (1)

rohit31_raj92
Active Participant
0 Likes

Hi You need to have bean entry as mentioned in the below screenshot.Please let me know if this not works for you. or it will be better if you mentioned what all steps you did and code changes you tried for removing the populator from list

https://wiki.hybris.com/pages/viewpage.action?spaceKey=release5&title=Converters+and+Populators

0 Likes

Thanks for the reply.. But I am not supposed to change the OOTB spring.xml right?.. thinking of having this remove code snip in my custom facades-spring.xml.. Should it suffice ?

0 Likes

Hi Viveksaipavan,

Yes, just use "remove" snippet in your custom spring.xml file, like below.

 <property name="remove" ref="searchResultSubscriptionProductPopulator"/>

Thanks..!!

former_member766891
Discoverer
0 Likes

This still does not work for with "remove" any idea what is missing? Thanks!