OK, so this was my own issue: I used $controller::curr()->Link() in an Elemental ContactForm::setFormAction(), which you do 😕 Not good…
This refers to the use of static::class - it works fine when called from the PageController, but not from the TaskRunner. Any ideas for a workaround maybe? Or is this a bug?
Request handler SilverStripe\Dev\TaskRunner does not have a url_segment defined
Hi all, I’ve created a task that indexes all pages for a seachengine, which is working fine, instantiating each page and grabbing the content I want. But when I call ElementalPageExtension::getElementsForSearch() from a Page method, I get the following error:
Also, just for someone who wants to know, if you put the form in the ElementController, then you need to reference it in your Element for it to be displayed:
So now my ElementController actually gets called! 🙂
Thanks! Just found out by going through code that the only thing to do was to set the FormAction to element/$ID/. No need for all that constructing nested controllers and stuff from the info - that is already handled 🙂
The only example of it’s use I can find is in the userforms element - but that is rather complex…