[wp-trac] Re: [WordPress Trac] #7435: Reply to comments from admin
WordPress Trac
wp-trac at lists.automattic.com
Wed Aug 27 12:47:44 GMT 2008
#7435: Reply to comments from admin
----------------------------+-----------------------------------------------
Reporter: ryan | Owner: azaozz
Type: enhancement | Status: new
Priority: normal | Milestone: 2.7
Component: Administration | Version:
Severity: normal | Resolution:
Keywords: blessed |
----------------------------+-----------------------------------------------
Comment (by caesarsgrunt):
Replying to [comment:7 azaozz]:
> That would mean the plugin will have to parse the HTML to modify it. Not
that easy/fast as supplying replacement form.
True, but I still think it would be nice if the plugin had the option to
do so, so as not to have to update the plugin every time slight changes
were made to the core.[[BR]]
It would still be able to just replace the whole form if it wanted.
Regardless of whether the HTML for the default form is passed to the
filter handler, it is essential that the variables passed to the
wp_comment_reply function are to be passed to it's filter. Otherwise the
plugin can't populate the hidden fields for checkbox, mode, and position,
which are essential for it to work on different pages.
I'll upload a patch in a moment. You'll note that I've passed an array of
these values as a third argument - replacing the second one with them
breaks something when my plugin isn't enabled.
[[BR]]
> Still not convinced we should allow that. There's a good reason why this
is not allowed in wp-comments-post.php too. Of course you can make a
plugin that would insert the comment directly and doesn't have this
restriction.
I don't understand where the security problem lies ''if'' the PHP script
checks to make sure the form was submitted by an admin if any advanced
metadata is set, but as you say the plugin can always handle the
submission itself so it's not ''that'' important.
[[BR]]
> > I meant the ''reply form'' as a row in the table, not my submitted
reply below the replyed-to comment. Like in my plugin. Interesting that
you had it like that and changed it...
>
> This has some other implications: now comments are listed on the write
page too, but there they are in the main form. Appending the comment reply
form inside the table would break the HTML completely (nested forms).
Ah. I hadn't noticed the comments on the edit post page.[[BR]]
I've modified my plugin so that it will work on this page too, so long as
the patch mentioned above is applied. Otherwise there's no sensible way
for it to know which page it's on.
For what it's worth I don't like the comments on this page where they are;
I think they should be below everything else rather than in one of the
meta boxes. I also think it's confusing sorting the comments in the
opposite order here from in the rest of the admin.
Anyhow, assuming it stays where it is, I have a few observations to
make.[[BR]]
1. Note that the nested forms thing actually this applies to the Manage
Comments page too...
1. Whilst this is undoubtedly incorrect HTML,
a. it's only generated by javascript, and[[BR]]
a. I don't think this makes any difference to the functionality of the
form which is submitted by AJAX, does it? Anyhow it works for me in
Firefox and Safari, not yet tested in other browsers...
1. This could be avoided by positioning the reply `form` in a `div`
outside the other `form`, adding a blank `tr` of the appropriate height,
and positioning the `div` absolutely on top of it.
1. It could also be avoided on the edit post page by moving the comments
outside (below) the edit post form, which IMO would be nicer from a UX
perspective anyway.
[[BR]]
> Agreed. Will add the Back button in the next patch.
Good. :-)
[[BR]]
Also, a bug report :[[BR]]
After adding a comment or multiple comments using the new reply form -
with ''or'' without my plugin enabled - the AJAX deletion of comments no
longer works, instead following the link and reloading the page as if
JavaScript was disabled.
Sorry for such a long response!
--
Ticket URL: <http://trac.wordpress.org/ticket/7435#comment:8>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list