Change Content Owner or Date

Change Content Owner or Date 2.0.15

No permission to download
ErrorException: Template error: Method canChangeAuthor is not callable on the given object (XFMG\XF\Entity\Post) src/XF/Template/Templater.php:936
Generated by: Unknown account 10/18/18 at 3:48 PM
Stack trace
#0 [internal function]: XF\Template\Templater->handleTemplateError(512, 'Method canChang...', '/home/nginx/dom...', 936, Array)
#1 src/XF/Template/Templater.php(936): trigger_error('Method canChang...', 512)
#2 internal_data/code_cache/templates/l1/s24/public/changeContentOwner_post_macros_action_bar.php(6): XF\Template\Templater->method(Object(XFMG\XF\Entity\Post), 'canChangeAuthor', Array)
#3 src/XF/Template/Templater.php(1250): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array)
#4 src/XF/Template/Templater.php(1324): XF\Template\Templater->renderTemplate('changeContentOw...', Array)
#5 internal_data/code_cache/templates/l1/s24/public/post_macros.php(381): XF\Template\Templater->includeTemplate('public:changeCo...', Array)
#6 src/XF/Template/Templater.php(663): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array, Array)
#7 internal_data/code_cache/templates/l1/s24/public/thread_view.php(539): XF\Template\Templater->callMacro('post_macros', 'post', Array, Array)
#8 src/XF/Template/Templater.php(1250): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array)
#9 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('thread_view', Array)
#10 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#11 src/XF/Mvc/Dispatcher.php(332): XF\Mvc\Renderer\Html->renderView('XF:Thread\\View', 'public:thread_v...', Array)
#12 src/XF/Mvc/Dispatcher.php(303): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#13 src/XF/Mvc/Dispatcher.php(44): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#14 src/XF/App.php(1931): XF\Mvc\Dispatcher->run()
#15 src/XF.php(329): XF\App->run()
#16 index.php(13): XF::runApp('XF\\Pub\\App')
#17 {main}
Request state
array(4) {
["url"] => string(75) "/threads/seeking-advices-for-transfer-apply-anew-to-stronger-program.22084/"
["referrer"] => bool(false)
["_GET"] => array(1) {
["/threads/seeking-advices-for-transfer-apply-anew-to-stronger-program_22084/"] => string(0) ""
}
["_POST"] => array(0) {
}
}
Delete
 
I can't reproduce any of those errors.
Likely those are produced by one of the bad versions you uploaded today. I never saw them before in version 1.0.0 and then I upgraded to 1.0.1 today.
Just upgraded to patch level 1 version and will watch them.
 
Very nice addon.

I do have one remark. the "Change post author" link is also visible on the first post. It isn't logic to have it there because it's the thread author post and is changed with "change thread author" in the mod menu.
 
Last edited:
They might have "Manage any post" permission.
this is admin and moderator permission in my forum, its related to change author?
i think its should not have permission to change author because its set to "no" and i dont want they have this permission, only for forum owner or specific user who have permission :)

2019-02-18_043047.webp
 
Is it so conceived? A user with the rights "Manage (move, merge, etc.) any thread" can change the author of the first message.

\src\addons\TickTackk\ChangeContentOwner\XF\Entity\Post.php
Code:
        if ($thread->first_post_id === $this->post_id)
        {
            return \XF::visitor()->hasNodePermission($thread->node_id, 'manageAnyThread');
        }

Right:
Code:
        if ($thread->first_post_id === $this->post_id)

        {

            return \XF::visitor()->hasNodePermission($thread->node_id, 'changePostAuthor');

        }

UPD:
Got it. it's not a bug... it's a feature!

If anyone needs, fix in the attachment.
 

Attachments

Last edited:
Great add-on. Thanks for your efforts. It seems to be working quite well for my purposes.

To add content in advance, I post under my admin account to a private forum that only admins can see. I change the author and also post date. Then, when the time comes, I simply move the thread out of the private "pending" forum and into an active one. It's a great way to "somewhat" automate fresh content.

However, one thing I'm noticing. I'm making the original posts under one of my admin accounts. It should have ZERO posts in the account's post history. However, the post count currently has over 30.

The add-on seems to be changing the author correctly, but it seems to be saving the post count of the OP. When you change the content owner, shouldn't the number of messages be added to the new owner and thus taken away from the old owner? It looks like this isn't happening, at least not for me.

BTW, I've run the cache tools, but no dice. The message count does not get updated and is still off.
 
I'm still having an issue.

I guess it isn't major, but it seems to be a problem.

The message count is not updating on the user profile page or in the user's postbit.

The account I'm using to make posts shows I have made 50 posts, but when you click on that number, none of those posts show up. Since all of those posts have been changed to different authors, no posts indeed should show, but the number of messages in the postbit/profile page should be zero.

Do you know of any way to fix this?
 
Top Bottom