Skip to:
Content
Pages
Categories
Search
Top
Bottom

Restore a topic does not work


  • Marco
    Participant

    @marco27

    Dear community,

    if I want to delete a topic or a post by clicking on “Recycle Bin”, it is no longer possible to restore the topic/post because the “marked” object has already been removed from the database.
    If I click on “Delete” again, the page is reloaded and I see all the topics that I had deleted. After reloading the page, these posts have disappeared.

    I use the bbpress version 2.6.6. The wordpress version is 5.7.2. I am using the Avada theme. The forum is password secured, so it is not possible for me to share a link here.

    Thank your very much if you know how to fix this issue.

    Kind regards
    Marco

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

  • Robin W
    Moderator

    @robin-w

    sorry, can you explain what you mean by clicking on “Recycle Bin”? Is this front end/backend or where are you seeing this?


    Marco
    Participant

    @marco27

    Hi Robin,

    it’s in the frontend. In the head of the posts there is a button “Papierkorb” (recycle bin).

    I check if the topic is listed in the wordpress-backend after clicking on the Recycle bin in the frontend. And there it is also removed.


    Robin W
    Moderator

    @robin-w

    ok, so the first click of ‘trash’ should not delete the topic, but place it in the trash. You should then see ‘delete’ and ‘restore’ on the front end.

    Is this is not what you are seeing?

    You can also see the topic in the backend in the ‘trash’ selection


    Marco
    Participant

    @marco27

    Yes, when I click on trash the topic is pushed to the trash section in the backend. BUT it is not possible to restore a topic or a post by clicking “restore” in the frontend. After clicking on “restore” there is a redirect to a textarea-input. But it is not possible to see the restored topic or the restored posts. And in the overview of the forum the topic which is pushed to the trash bin is not displayed.

    I use the moderator role in the forum and the moderator should not have access to the backend. So restoring topics in the backend is no option for me.
    I also check this with an other theme (Twenty-Twenty-one), but it did not change the problem.
    So the situation is not very satisfying.


    Marco
    Participant

    @marco27

    And after clicking on “delete” in the frontend, which should delete the topic finally from the database, the “deleted” topic is shown in the overview of the forum. After reloading the page, the deleted topics are disappeared.


    Marco
    Participant

    @marco27

    In my last post there is a wrong information. After clicking on delete in the frontend, the page with the forum overview reloads and shows topics which are pushed to trash. Curiously not all topics from “trash” are displayed in the frontend. It looks absolutly random. And its absolutly not possible to change the status of the “trashed” topic in the frontend.

    I also deactivate some plugins which extends the bbpress plugin. But that takes also no effect.

    Does anyone have an idea?


    Robin W
    Moderator

    @robin-w

    I’ve just taken a look at the front end restore.

    The bbpress restore function calls a wordpress function wp_untrash_post which sets the restored status to ‘draft’.

    I’m pretty sure that it didn’t used to do that, so am presuming it’s a wordpress change.

    However if you are using

    bbp style pack

    then I’ve added a fix for this to the ‘bbpress bug fixes’ tab.

    If you want code, then put this in your child theme’s function file –

    ie wp-content/themes/%your-theme-name%/functions.php

    where %your-theme-name% is the name of your theme

    or use

    Code Snippets

    add_filter ('wp_untrash_post_status', 'rew_correct_untrash_status' , 10, 3) ;
    
    function rew_correct_untrash_status ($new_status, $post_id, $previous_status) {
    	$post_check = get_post( $post_id );
    	//update_post_meta ($post_id , 'rew_type', $post_check->post_type) ;
    	//if it's a reply or topic, then change status back to $previous_status
    	if ($post_check->post_type == bbp_get_reply_post_type() || $post_check->post_type == bbp_get_topic_post_type()) {
    		$new_status = $previous_status ;
    	}
    return $new_status ;
    }

    Marco
    Participant

    @marco27

    Hi Robin,

    thank you very much for the code snippet! I add this to the functions.php of the child theme and it works.

    Yesterday I detect an other strange behavior. If I click on “reply” in the frontend on the first post of a topic, the page also reloads and the reply will not be nested under the replied post. Clicking twice set a relation to the replied post and set it as a nested post.

    Do you have an idea how I can solve this?

    Kind regards
    Marco


    Robin W
    Moderator

    @robin-w

    try

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>bug fixes

    Fix Threaded Replies Jump


    Marco
    Participant

    @marco27

    Hi Robin,

    thank you very much.

    Currently it is not possible to make a nested reply on the first post of the topic. Only at the second post the nested reply works. I think that is not a concept of bbpress and has to do with the last wordpress update?

    Kind regards


    r-a-y
    Participant

    @r-a-y

    I posted a ticket about this here: https://bbpress.trac.wordpress.org/ticket/3433

    It’s an issue since WordPress 5.6.0.

Viewing 11 replies - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.
Skip to toolbar