Skip to:
Content
Pages
Categories
Search
Top
Bottom

Problem deleting posts


  • wizzard1981
    Member

    @wizzard1981

    Hello,

    I’m having troubles with the bbPress 1.0-alpha-2 when removing in the admin page some posts.

    Warning: Invalid argument supplied for foreach() in /usr/home/xxx/domains/xxx/public_html/bbpress/bb-includes/functions.php on line 527

    Warning: Cannot modify header information – headers already sent by (output started at /usr/home/xxx/domains/xxx/public_html/bbpress/bb-includes/functions.php:527) in /usr/home/xxx/domains/xxx/public_html/bbpress/bb-includes/pluggable.php on line 214

    Cheers,

    Kris

Viewing 7 replies - 1 through 7 (of 7 total)

  • chrishajer
    Participant

    @chrishajer

    What do you mean “removing in the admin page some posts”? When you’re logged in as keymaster, don’t you have the ability to edit or delete posts when viewing the topic? Are you doing this in the admin section somewhere or are you doing this from the topic page with the [delete] link?

    When I am in the admin section and select Manage > Posts, I see only deleted posts there, not all posts that I CAN delete. I can restore deleted posts from here.

    This is 1.0-alpha-2 same as yours, non-integrated. I can’t recreate the problem.

    Hi,

    I;ve just noticed that I get this issue as well. It seems to happen when there is only one message in the topic.

    So when yu are logged in as Keymaster and go the the topic and then click DELETE under the message, the ajaxy stuuf does it’s wipe up and then the message re-eappares on the page but with the “Invalid argument for foreach error” just above the message again.

    See http://demo.karavadra.net/bbpress/2008-18-10-admin-delete-one-message.gif

    Forgot to say that the message does actually get deleted. I think it’s something to do with the foreach statement for there only being one message.

    I’m also using alpha 2 but intgrated with WP.


    chrishajer
    Participant

    @chrishajer

    If you are deleting the only post in a topic, you should probably be deleting the whole topic, not just the post. I can see that bbPress should probably catch that, but if you delete the topic rather than the post, does it error out?

    Why would you delete the only post in a topic? What would be left?


    _ck_
    Participant

    @_ck_

    Actually bbPress should handle a one-post topic delete as the full topic delete, I think that bug was addressed awhile ago but may have been reintroduced. A foreach won’t fail on one item, as long it’s still an array. Zero items is a problem though.


    chrishajer
    Participant

    @chrishajer

    I don’t think the problem is with deleting a whole topic when there’s only one post in it. The problem as I understand it is that when deleting the only post in a topic, this error occurs.

    I just verified that this occurs on a trunk installation (r1794) if you try to delete the only post of a topic.

    Warning: Invalid argument supplied for foreach() in /homepages/46/d93980635/htdocs/trunk/bb-includes/functions.php on line 527

    That was my point a couple posts ago. bbPress should handle this, or remove the option to delete the post if it’s the only post on a topic, but in reality, administrators should be deleting the whole topic, not the only post in that topic. When you delete the only post of a topic, what are you expecting to be left over?

    The post is gone, and the thread no longer shows up in the front page forum list, but I think bbPress or the administrator could be smarter about how to accomplish what we’re really trying to do here.

    but in reality, administrators should be deleting the whole topic, not the only post in that topic. When you delete the only post of a topic, what are you expecting to be left over?

    Yes, it’s a case of user-error finding a bug that should be caught. The code should say ‘hey, this is the only post, he must mean delete topic’ and move on, or the ‘delete post’ option shouldn’t even be there if it’s the only post in a topic. You’re both right :) Code should know better, user should read more (and FWIW, I made the same error when I was testing bbpress).

Viewing 7 replies - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.