Change Content Owner or Date

Change Content Owner or Date 2.0.15

No permission to download
Code:
TypeError: Argument 2 passed to TickTackk\ChangeContentOwner\XF\Service\Post\AuthorChanger::updateNewsFeed() must be an instance of XF\Entity\User, null given, called in /home/xxyy/public_html/src/addons/TickTackk/ChangeContentOwner/XF/Service/Post/AuthorChanger.php on line 231 in src/addons/TickTackk/ChangeContentOwner/Service/ContentTrait.php at line 20

    TickTackk\ChangeContentOwner\XF\Service\Post\AuthorChanger->updateNewsFeed() in src/addons/TickTackk/ChangeContentOwner/XF/Service/Post/AuthorChanger.php at line 231
    TickTackk\ChangeContentOwner\XF\Service\Post\AuthorChanger->_save() in src/XF/Service/ValidateAndSavableTrait.php at line 40
    TickTackk\ChangeContentOwner\XF\Service\Post\AuthorChanger->save() in src/addons/TickTackk/ChangeContentOwner/XF/Pub/Controller/Post.php at line 48
    TickTackk\ChangeContentOwner\XF\Pub\Controller\Post->actionChangeAuthor() in src/XF/Mvc/Dispatcher.php at line 321
    XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 248
    XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 100
    XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 50
    XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2177
    XF\App->run() in src/XF.php at line 390
    XF::runApp() in index.php at line 20

2.1.1

I get this error if I want to process a deleted member's message - which appears as a deleted member, deleted the nickname - in the message.
 
Last edited:
2.1.1

I get this error if I want to process a deleted member's message - which appears as a deleted member, deleted the nickname - in the message.
same here, this error appear if i change a post/thread author from deleted member

Code:
Server error log

    TypeError: Argument 2 passed to TickTackk\ChangeContentOwner\XF\Service\Post\AuthorChanger::updateNewsFeed() must be an instance of XF\Entity\User, null given, called in E:\Wnmp\html\sites\src\addons\TickTackk\ChangeContentOwner\XF\Service\Post\AuthorChanger.php on line 231 src\addons\TickTackk\ChangeContentOwner\Service\ContentTrait.php:20

    Generated by: maszd Mar 29, 2019 at 7:37 PM

Stack trace

#0 src\addons\TickTackk\ChangeContentOwner\XF\Service\Post\AuthorChanger.php(231): TickTackk\ChangeContentOwner\XF\Service\Post\AuthorChanger->updateNewsFeed(Object(xenMade\EAS\XF\Entity\Post), NULL, Object(xenMade\EAS\XF\Entity\User))
#1 src\XF\Service\ValidateAndSavableTrait.php(40): TickTackk\ChangeContentOwner\XF\Service\Post\AuthorChanger->_save()
#2 src\addons\TickTackk\ChangeContentOwner\XF\Pub\Controller\Post.php(48): TickTackk\ChangeContentOwner\XF\Service\Post\AuthorChanger->save()
#3 src\XF\Mvc\Dispatcher.php(321): TickTackk\ChangeContentOwner\XF\Pub\Controller\Post->actionChangeAuthor(Object(XF\Mvc\ParameterBag))
#4 src\XF\Mvc\Dispatcher.php(244): XF\Mvc\Dispatcher->dispatchClass('XF:Post', 'ChangeAuthor', Object(XF\Mvc\RouteMatch), Object(xenMade\EAS\XF\Pub\Controller\Post), NULL)
#5 src\XF\Mvc\Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(xenMade\EAS\XF\Pub\Controller\Post), NULL)
#6 src\XF\Mvc\Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#7 src\XF\App.php(2177): XF\Mvc\Dispatcher->run()
#8 src\XF.php(390): XF\App->run()
#9 index.php(20): XF::runApp('XF\\Pub\\App')
#10 {main}

Request state

array(4) {
  ["url"] => string(26) "/posts/65293/change-author"
  ["referrer"] => string(39) "https://sites/threads/salam-kenal.1871/"
  ["_GET"] => array(1) {
    ["/posts/65293/change-author"] => string(0) ""
  }
  ["_POST"] => array(5) {
    ["new_author_username"] => string(6) "Tester"
    ["_xfToken"] => string(8) "********"
    ["_xfRequestUri"] => string(26) "/threads/salam-kenal.1871/"
    ["_xfWithData"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}
 
Hi @batpool52!
change post author link still appear for all admin and moderator, even if permission set to "no"

View attachment 195853

View attachment 195854

regards.
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 :)

View attachment 195916
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.
Seeing same bug. Such a shame, since add on implements very flexible permission groups then overrides these with the manage post permission. I do want all moderators who have manage post permission being able to change post owner. I want just admins to do this. Also problematic since you could set permission to Never and still have permission. Great addon but please fix this issue. Also do not like menu being before default XF menus (Edit, Delete). Should be after. Thanks!
 
You should be making use of "Change thread author" instead of "Change post author" as changing first post author can create issues.
 
It looks like that your addons kills the "Change Date 2.2 from AndyB."
Solved with 1.1.4

But maybe you want to add the Date function also to your addon? It would be nice to have both with one click instead two clicks.
 
Last edited:
The functionallity to recalc the position of posts.

The situation now:
Test Server: Deactivated some addons => no result;
update from 1.1.3 to 1.1.4 => the recalc of position is ok.

Client Server: All addons running, 1.1.4 and 2.2, but the recalc of postion is not done.


change_date.gif


--- changed ---

1. Maybe it is not your addon, maybe it is the comment addon from TH that makes the problem.
The client server can change now date and position after deactivating comments addon and your addon.

2. Change content is now activated again and the date can be changed and postition is recalced.

Probably the problem is the comment addon (or the sum of some addons?)
 
Last edited:
Top Bottom