the method 'forTemplate' does not exist on 'SilverStripe\ORM\ArrayList

<%- if @topic_view.topic.tags.present? %>
<%= t 'js.tagging.tags' %>: <%- @topic_view.topic.tags.each do |t| %> <%= t %> <%- end %>
<% end %>

Silverstripe 4

I’m getting a server error when trying to access the default reset password form via the url /Security/lostpassword

Log details: [2021-01-23 22:01:09] error-log.ERROR: Uncaught Exception BadMethodCallException: “Object->__call(): the method ‘forTemplate’ does not exist on ‘SilverStripe\ORM\ArrayList’” at /var/app/current/vendor/silverstripe/framework/src/Core/CustomMethods.php line 54 {“exception”:"[object] (BadMethodCallException(code: 0): Object->__call(): the method ‘forTemplate’ does not exist on ‘SilverStripe\ORM\ArrayList’ at /var/app/current/vendor/silverstripe/framework/src/Core/CustomMethods.php:54)"}

I’m a bit stumped because as far as I am aware I am just trying to access the core reset password form. I am extending the MemberLoginForm though, so could this possibly be causing the error?

mysite.yml
SilverStripe\Core\Injector\Injector:
MemberLoginForm:
class: MyCustomLoginForm

Any help will be greatly appreciated.
Thanks

I don’t think that yml should affect the reset form. But your Page.ss template could possibly be causing a problem, since it would wrap the password reset form. The error sounds like you have an array list somewhere and are trying to render it directly in a template (e.g. `$MyArrayList) instead of looping over it. As a start maybe try deleting most of the code from your Page.ss and see if that fixes it?

Hi Jono,
Thanks for your reply. I have deleted most of the code from Page.ss and unfortunately I am still getting the server error. Any other suggestions? I forgot to mention that I am upgrading from SS3 to SS4, so perhaps I have missed something in the process (possibly within a controller).
Here is my remaining code from Page.ss

$Layout

If you comment out the yml to override the custom login form and ?flush does that have any effect?