• Resolved ldwd

    (@ldwd)


    Another bug found ??

    The links for editing and deleting editorial comments are missing in the latest version(s) of PP Planner, also on clean WP installations:

    Installing PP Capabilities reveals the capabilities for these actions are missing (which I know are present in previous versions, at least 3.12.2 and before).

    No editorial comments capabilities are available, while the editorial metadata capabilities are in the Additional tab instead of PP Planner tab:

    In previous versions, all of them are available and in the right tab:

    For debugging purposes I imported the capabilities from my old installation into the clean one, after which the links appeared:

    But… there is a second issue: as long as pp edit others editorial comment and pp delete others editorial comment are not granted, one can not edit or delete their own comments as well. And there is no way to grant any of them with Capabilities plugin either.

    Please fix and add those capabilities to the PP Planner plugin and please also include edit post subscriptions and pp set notification channel by default, because it is not very user friendly that one has to install a second plugin just to fully use the plugin they actually want.

    Thanks!

    • This topic was modified 9 months, 3 weeks ago by ldwd. Reason: Corrected version numbers
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support Riza Maulana Ardiyanto

    (@rizaardiyanto)

    Hi @ldwd

    Thanks for your detailed reports.

    I’m able to replicate these issues and have opened both issues on our GitHub repo:

    https://github.com/publishpress/PublishPress-Capabilities/issues/1123

    https://github.com/publishpress/PublishPress-Planner/issues/1555

    Thanks,

    Thread Starter ldwd

    (@ldwd)

    @rizaardiyanto Thanks, I look forward to the updates!

    I do miss one part in your issues on GitHub: pp edit editorial comment and pp delete editorial comment have no effect on a users own comments (the edit/delete links are still missing) as long as pp edit others editorial comment and pp delete others editorial comment are not granted too.

    Thanks!

    Plugin Support Riza Maulana Ardiyanto

    (@rizaardiyanto)

    @ldwd There is old issue already related to that one. I’m re-opening the issue now so our developer can check it again: https://github.com/publishpress/PublishPress-Planner/issues/1420

    Thread Starter ldwd

    (@ldwd)

    @rizaardiyanto Okay, thanks!

    From your last GitHub link in our other thread (about Stop Notify Me link) I think I localized the bug with this last issue. In /modules/editorial-comments/editorial-comments.php there are two if-statements that can never be true.

    On line 625:

    if ( ( $user->user_nicename == $theComment->comment_author && current_user_can('pp_edit_editorial_comment') || current_user_can('pp_edit_others_editorial_comment') ) )

    On line 638:

    if ( ( $user->ID === $theComment->comment_author && current_user_can('pp_delete_editorial_comment') || current_user_can('pp_delete_others_editorial_comment') ) )

    $user->user_nicename returns a slug while $theComment->comment_author returns i.e. full name or display name.

    Also, in both statements a ) is placed wrong.

    I changed both to this which solves the problem:

    if ( ( $user->ID == $theComment->user_id && current_user_can(
    'pp_edit_editorial_comment' ) ) || current_user_can('pp_edit_others_editorial_comment') )

    if ( ( $user->ID == $theComment->user_id && current_user_can(
    'pp_delete_editorial_comment' ) ) || current_user_can('pp_delete_others_editorial_comment') )

    I hope this helps you save some time ??

    Thread Starter ldwd

    (@ldwd)

    @rizaardiyanto Actually, this solved the issue partly. The links are there, but they don’t work since the user doesn’t get the privilege to edit/delete due to three other if-statements with the same structure.

    On line 922:

    if ( ! ($current_user->user_nicename == $theComment->comment_author && current_user_can( 'pp_edit_editorial_comment' )) && ! current_user_can('pp_edit_others_editorial_comment') )

    On line 1052 and 1165:

    if ( ! ($current_user->user_nicename == $theComment->comment_author && current_user_can( 'pp_delete_editorial_comment' )) && ! current_user_can('pp_delete_others_editorial_comment') )

    Changing those to check on ID too makes it all work correctly ??

    Plugin Support Riza Maulana Ardiyanto

    (@rizaardiyanto)

    Thread Starter ldwd

    (@ldwd)

    @rizaardiyanto This one:

    https://github.com/publishpress/PublishPress-Planner/issues/1420

    I only mentioned our other topic because that’s where you pointed me to a file (for something else), in which I happen to find the bug reported in this topic. Sorry for the confusion.

    Plugin Support Riza Maulana Ardiyanto

    (@rizaardiyanto)

    @ldwd Ah no worries. Thanks for confirming

    I have added that as additional information on GitHub issue. Thanks for your valuable information!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Missing links for editing / deleting editorial comments’ is closed to new replies.