Jump to content

[BUG 4.7.17] Adding form fields to \IPS\Content\Item::commentFormElements() doesn't fully work


Go to solution Solved by Daniel F,

Recommended Posts

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().

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...