Skip to main content

move post to another space

If I, as an admin, want to move a post to another space, I receive the following error:

The author is not a member of the selected space

I know the user is not a member of the target space. I just checked the related code in FeedsController.php:

            if (!Helper::isUserInSpace($existingFeed->user_id, $newSpaceId)) {
                return $this->sendError([
                    'message' => __('The author is not a member of the selected space', 'fluent-community')
                ]);
            }

            $newSpace = Space::findOrFail($newSpaceId);

            // check if the current user is admin
            if (!$user->hasPermissionOrInCurrentSpace('community_admin', $newSpace)) {
                return $this->sendError([
                    'message' => __('Sorry, you do not have permission to change the space for this post', 'fluent-community')
                ]);
            }

I think the logic could be improved. If the current user is an admin, they should be able to move the post regardless of whether the author is a member of the target space.

Shahjahan Jewel

No that will break many functionalities. Like, let's the target space is private, and if the author is not in the community, then notifications will break and same time the comments will leak private info like who the members of that space are. We gave a lots of thoughts about this feature when we implemented.

Peng Xie

Shahjahan JewelΒ I’m bringing this up because of this post: https://community.wpmanageninja.com/portal/space/community-meta/post/request-archiving-a-post

Before an official archive function is available, this is the only method I can use, so I have to move all spam posts to the β€œArchive” space. As I mentioned, this logic and function should be available only to administrators, so I don’t see any issue with it. I just edited the PHP file, and I have moved many posts without experiencing any notification errors.

Shahjahan Jewel

Peng XieΒ We already have that feature. It's called unlist post. So if you unlist a post then that post will be unlisted from the space and global feeds and only exist to the author's profile.

1.00

Peng Xie

Shahjahan JewelΒ no the unlist post function is not archive function.

Let me explain further why an archive function is needed. For instance, suppose a scammer posts an offer on my forum to sell a cheap iPhone 18 Pro, and a victim has already reported the matter to the police. I need to preserve the post, but obviously, I cannot allow anyone other than administrators and the police to see it. In fact, in Europeβ€”that wretched placeβ€”there are many situations in which you have to retain a great deal of evidence simply to avoid further trouble.

Of course, for administrative purposes, it is often necessary to have a staging areaβ€”similar to an archive sectionβ€”where posts are preserved rather than deleted, pending their release at an appropriate time. These operations can only be performed by administrators; once a post enters the archive, no one elseβ€”not even the original authorβ€”can modify it.

I have just tested this: If I move a post to the β€œArchive” space, the author can still see it on their profile page, but can no longer edit it. This is exactly what I need to comply with the law.

Peng Xie

Shahjahan JewelΒ Going a step further, I also need a feature that prevents authors from deleting or editing their posts after a certain amount of time has passed. I’ve identified some hooks that should handle this, and I’m currently experimenting with them…

Jacob Windham

as a quick fix until something else is available, you could make a private space and move the post there. you could even call it "archive"

Peng Xie

Jacob WindhamΒ Yes, I have the same idea, as I wrote here: https://community.wpmanageninja.com/portal/space/community-meta/post/request-archiving-a-post

I used to recommend this to others, as I had done for the past 20 years, but I’ve found that I can’t do so within FluentCommunity.

The problem is that in FluentCommunity, if a user is not a member of this secret space, you cannot move their post there. This is different from the other classic forums I have used over the past 20 years. Of course, I cannot add everyone to this space; if everyone could enter, it would no longer be a β€œsecret” space.

Jacob Windham

Peng XieΒ sorry. I was quick reading an missed that. I could think of a few workarounds but a native function would be nice.

Peng Xie

Jacob WindhamΒ πŸ‘ Yes, a native function is what I want. I modified the PHP file yesterday, and it works, but I don't like this approach because I won't be able to update the plugin automatically in the future.

J V

Just to add perspective, because forums are popular for people and scammers, this request is actually kind of necessary. I think a soft delete feature would be simpler but the main point is that Law Enforcement may request that we keep some data for a period of time. Currently that would look like a full backup. But the more search engines and people move back to forums, the more important this becomes from a compliance issue GDPR and other versions of it as well as fraud or search warrants. I’m not sure the best way to implement but this is a common issue with any forum with a lot traffic where things or services might be exchanged