Multiple AjaxWidgets on one Site seems to use the same WidgetContext...
I use the (same) AjaxWidget multiple times in the same template. Problem seems that all generated widgets had the same widgetContext (despite different widgetIds)
Result: all Widgets have the same (last widgets) Content...
Reason: I think the Reason is in AjaxWidgetContextHolder.php Line 72: $this->widgetContexts[$ajaxWidgetId] = $widgetContext; (because there is just stored an objectreference in that array instead of cloning)
Workarround: AbstractWidgetViewHelper.php has an function called resetState() which seems to correct that issue. Should be called in initializeArgumentsAndRender() (or some better place) for AjaxWidgets...
Flow: 4.3.3
Issue still exists in Flow 5.3.8
@nixahnung I personally do this A LOT (from Flow 3 to 6) and never experencied that behavior. Could you gist somewhere an example widget, that will show this behavior if instantiated multiple times?
If this happens in a ForViewHelper than we have encountered this problem, too. The reason for this is that only one instance of the WidgetViewHelper will be created and therefore the later occurancies overwrites the ones before.