Widgets don't work anymore in infinete scroll after upgrade to Shopware 5.7.2

For our customer we upgraded Shopware to version 5.7.2.

After the upgrade to the latest version infinite scroll is not working anymore when we have a own widget in our template. All widgets we have created are not working anymore when using infinite scroll.

The first page is loaded perfect but when we scroll down, the system hangs on the js error:
Uncaught TypeError: Cannot read property ‚trim‘ of undefined.

1629951430_3be3945772966d351e47896c86d3ae64.js:665 Uncaught TypeError: Cannot read property ‚trim‘ of undefined
at Plugin.appendListing (1629951430_3be3945772966d351e47896c86d3ae64.js:665)
at Plugin.i (1629951430_3be3945772966d351e47896c86d3ae64.js:5)
at Object.success (1629951430_3be3945772966d351e47896c86d3ae64.js:573)
at c (1629951430_3be3945772966d351e47896c86d3ae64.js:5)
at Object.fireWith [as resolveWith] (1629951430_3be3945772966d351e47896c86d3ae64.js:5)
at l (1629951430_3be3945772966d351e47896c86d3ae64.js:5)
at XMLHttpRequest. (1629951430_3be3945772966d351e47896c86d3ae64.js:5)

I removed all custum build pug-ins and switched to the responsive theme but the issue still ocures.
Any idea what can couse this problem. When wesSwitch off infinite scroll everything is working again.

Hello,

I cannot reproduce this on the current development branch of Shopware 5.7.
Did you cleared the cache and compile the theme anew after uninstalling all the plugins?

Best regards from Schöppingen
Michael Telgmann

Hi Michael,

Yes I did.

What I just did is:

  • I created a new environment with Shopware 5.7.2 with the demo data.
  • I created a small plugin with a widget
  • Installed the plugin
  • I duplicated products to have enough for infinite scrolling
  • Added the widget in Resonsive theme in themes/Frontend/Bare/frontend/listing/product-box/box-basic.tpl
  • Tested this

What happens? The page loads only the first products (page) and the ajax call runs for ever when you scroll down.

You can test the behaviour at:

You can download the plug-in with the following url:
http://testsw5.treshold.nl/Testwidgets.zip

Hello Jeroen,

with the help of your plugin, I was able to reproduce the error. I created a ticket for that, as your plugin is working fine with Shopware 5.6. Shopware Issuetracker

Best regards from Schöppingen
Michael Telgmann