Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt November 11, 2024
teraßyte Posted July 11, 2024 Posted July 11, 2024 I'm adding some custom fields to a comment form in an application, however, adding them is a nightmare, unlike the normal form for the item itself. I had to alter the commentTemplate form template to place the fields in the correct position above the editor. Without the template edit, the fields were added at the bottom inline with the submit button, and the whole look was messed up. There is no easy way to only overload the comment template. I had to copy both commentContainer and comment to use my custom comment template. The \IPS\Content\Controller::_edit() class that loads the edit code/form doesn't use \IPS\Content\Item::commentFormElements() to load the fields, so I had to overload the whole function and add my own field code in there since there is no usable hook point/extension that can be used. The same also applies to \IPS\Content\Item::processCommentForm() since it's not called when editing a comment. Overall the whole process of adding fields to a comment form is a mess. And I assume the same applies to the review form. I expected it to work as it does for items with formElements() and processForm(). Adriano Faria and SeNioR- 2
teraßyte Posted July 11, 2024 Author Posted July 11, 2024 So, it seems that \IPS\Content\Item::processCommentForm() does not save any values/changes you make to it unless you call save() yourself. That's another difference compared to how the Content Item itself is handled. 🤷♂️ SeNioR- 1
Marc Posted July 12, 2024 Posted July 12, 2024 Thank you for bringing this issue to our attention! I can confirm this should be further reviewed and I have logged an internal bug report for our development team to investigate and address as necessary, in a future maintenance release. teraßyte 1
Solution Daniel F Posted July 16, 2024 Solution Posted July 16, 2024 The way how this works in v5 changed completely and this would be some too big changes for v4 so we'll probably close the bug report for now. SeNioR- 1
teraßyte Posted July 16, 2024 Author Posted July 16, 2024 Yeah, I figured it wouldn't change for v4 at this point. I'm good as long as it's easier to implement it in v5. 👍
Recommended Posts