Change Content Owner

Change Content Owner 2.0.0 Release Candidate 2

No permission to download

Bob

Well-known member
@Bob would love if this could be integrated with UBS too.. :giggle:
UBS has "reassign" functionality built in for changing the content owner of Blogs, Blog Entries, Comments and Reviews.

Will your addon also support Showcase in the future?
Showcase has "reassign" functionality built in for changing the content owner of Items, Comments, Reviews and Replies to Reviews.

If either of you have questions, just ask at the support forum (or contact me privately).
 

duderuud

Well-known member
Looking for a way to give multiple users the ability to edit the first post in a thread...
I know certain forums support this.
 

Xon

Well-known member
Looking for a way to give multiple users the ability to edit the first post in a thread...
I know certain forums support this.
I have a paid add-on which implements something like this;
 

sbj

Well-known member
Looking for a way to give multiple users the ability to edit the first post in a thread...
I know certain forums support this.
 

Nirjonadda

Well-known member
@batpool52! How can disable showing change owner date box from editing user post and Edit thread? I want only in inline moderation. Please can you add option for disable showing change owner date box from editing post and Edit thread?
 

Fatih Özcan

Active member
Hello,

I have been using your addon together @truonglv 's post reply addon on my site.
Post Reply

When I try to edit main profile message there is no problem but When ı try to edit a comment I am getting below error.

Can you help me about this please? If I disable your addon everything is OK again but I don't prefer this.

I have been using Xenforo 2.1.3 release.

Thanks

PHP:
Server Error Log

LogicException: Could not find repository 'XF\Repository\ProfilePostComment' for 'XF:ProfilePostComment' src/XF/Mvc/Entity/Manager.php:258

tarafından oluşturuldu: Fatih Özcan 7 Ağustos 2019 11:44



Stack Trace

#0 src/XF/Mvc/Controller.php(849): XF\Mvc\Entity\Manager->getRepository('XF:ProfilePostC...')

#1 [internal function]: XF\Mvc\Controller->repository('XF:ProfilePostC...')

#2 src/XF/ControllerPlugin/AbstractPlugin.php(79): call_user_func_array(Array, Array)

#3 src/addons/TickTackk/ChangeContentOwner/ControllerPlugin/Content.php(97): XF\ControllerPlugin\AbstractPlugin->__call('repository', Array)

#4 src/addons/TickTackk/ChangeContentOwner/XF/Pub/Controller/ProfilePost.php(112): TickTackk\ChangeContentOwner\ControllerPlugin\Content->extendContentEditAction(Object(XF\Mvc\Reply\View), 'comment', 'XF:ProfilePostC...')

#5 src/XF/Mvc/Dispatcher.php(321): TickTackk\ChangeContentOwner\XF\Pub\Controller\ProfilePost->actionCommentsEdit(Object(XF\Mvc\ParameterBag))

#6 src/XF/Mvc/Dispatcher.php(244): XF\Mvc\Dispatcher->dispatchClass('XF:ProfilePost', 'Commentsedit', Object(XF\Mvc\RouteMatch), Object(TickTackk\ChangeContentOwner\XF\Pub\Controller\ProfilePost), NULL)

#7 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(TickTackk\ChangeContentOwner\XF\Pub\Controller\ProfilePost), NULL)

#8 src/XF/Mvc/Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))

#9 src/XF/App.php(2178): XF\Mvc\Dispatcher->run()

#10 src/XF.php(390): XF\App->run()

#11 index.php(20): XF::runApp('XF\\Pub\\App')

#12 {main}



Request State

array(4) {

  ["url"] => string(168) "/durum-guncellemesi/yorum/21196/edit?_xfRequestUri=%2Fuyeler%2Flizzie.22184%2F&_xfWithData=1&_xfToken=1565167434%2C9273b93080e2654464c394a152671c30&_xfResponseType=json"

  ["referrer"] => string(54) "https://www.cevremuhendisleri.net/uyeler/aaaa/"

  ["_GET"] => array(4) {

    ["_xfRequestUri"] => string(21) "/uyeler/lizzie.22184/"

    ["_xfWithData"] => string(1) "1"

    ["_xfToken"] => string(43) "1565167434,9273b93080e2654464c394a152671c30"

    ["_xfResponseType"] => string(4) "json"

  }

  ["_POST"] => array(0) {

  }

}
 

rfc0001

Well-known member
Bug: If you edit a deleted users post you get the following error:
  • InvalidArgumentException: Column 'user_id' is read only, can only be set with forceSet
  • src/XF/Mvc/Entity/Entity.php:593
  • Generated by: Russ
  • Aug 13, 2019 at 3:39 PM
Stack trace
Code:
#0 src/addons/TickTackk/ChangeContentOwner/ChangeOwner/AbstractHandler.php(134): XF\Mvc\Entity\Entity->set('user_id', 0)
#1 src/addons/TickTackk/ChangeContentOwner/ChangeOwner/AbstractHandler.php(92): TickTackk\ChangeContentOwner\ChangeOwner\AbstractHandler->getFallbackOldOwner(Object(XFMG\XF\Entity\Post))
#2 src/addons/TickTackk/ChangeContentOwner/Service/Content/AbstractOwnerChanger.php(280): TickTackk\ChangeContentOwner\ChangeOwner\AbstractHandler->getOldOwner(Object(XFMG\XF\Entity\Post))
#3 src/addons/TickTackk/ChangeContentOwner/Service/Content/AbstractOwnerChanger.php(436): TickTackk\ChangeContentOwner\Service\Content\AbstractOwnerChanger->getOldOwner(Object(XFMG\XF\Entity\Post))
#4 src/addons/TickTackk/ChangeContentOwner/Service/Content/EditorTrait.php(63): TickTackk\ChangeContentOwner\Service\Content\AbstractOwnerChanger->apply()
#5 src/addons/TickTackk/ChangeContentOwner/ControllerPlugin/Content.php(117): TickTackk\ChangeContentOwner\XF\Service\Post\Editor->applyOwnerChanger()
#6 src/addons/TickTackk/ChangeContentOwner/XF/Pub/Controller/Post.php(56): TickTackk\ChangeContentOwner\ControllerPlugin\Content->extendEditorService(Object(XFMG\XF\Entity\Post), Object(TickTackk\ChangeContentOwner\XF\Service\Post\Editor), 'XF:Post')
#7 src/XF/Pub/Controller/Post.php(116): TickTackk\ChangeContentOwner\XF\Pub\Controller\Post->setupPostEdit(Object(XFMG\XF\Entity\Post))
#8 src/addons/xenMade/SEO/XF/Pub/Controller/Post.php(88): XF\Pub\Controller\Post->actionEdit(Object(XF\Mvc\ParameterBag))
#9 src/addons/TickTackk/ChangeContentOwner/XF/Pub/Controller/Post.php(68): xenMade\SEO\XF\Pub\Controller\Post->actionEdit(Object(XF\Mvc\ParameterBag))
#10 src/addons/EWR/Porta/Pub/Controller/Post.php(39): TickTackk\ChangeContentOwner\XF\Pub\Controller\Post->actionEdit(Object(XF\Mvc\ParameterBag))
#11 src/addons/Andy/InsertAttachment/XF/Pub/Controller/Post.php(17): EWR\Porta\Pub\Controller\Post->actionEdit(Object(XF\Mvc\ParameterBag))
#12 src/XF/Mvc/Dispatcher.php(321): Andy\InsertAttachment\XF\Pub\Controller\Post->actionEdit(Object(XF\Mvc\ParameterBag))
#13 src/XF/Mvc/Dispatcher.php(244): XF\Mvc\Dispatcher->dispatchClass('XF:Post', 'Edit', Object(XF\Mvc\RouteMatch), Object(Andy\ConvertToJpg\XF\Pub\Controller\Post), NULL)
#14 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(Andy\ConvertToJpg\XF\Pub\Controller\Post), NULL)
#15 src/XF/Mvc/Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#16 src/XF/App.php(2178): XF\Mvc\Dispatcher->run()
#17 src/XF.php(390): XF\App->run()
#18 index.php(20): XF::runApp('XF\\Pub\\App')
#19 {main}
After which Content Owner spews errors for every request on your forum:
  • ErrorException: Template error: Method canChangeOwner is not callable on the given object (EWR\Porta\Entity\Thread)
  • src/XF/Template/Templater.php:994
  • Generated by: Unknown account
  • Aug 13, 2019 at 3:39 PM
Stack trace
Code:
#0 [internal function]: XF\Template\Templater->handleTemplateError(512, 'Method canChang...', '/home/dvcinfo1/...', 994, Array)
#1 src/XF/Template/Templater.php(994): trigger_error('Method canChang...', 512)
#2 internal_data/code_cache/templates/l1/s1/public/tckChangeContentOwner_macros.php(66): XF\Template\Templater->method(Object(EWR\Porta\Entity\Thread), 'canChangeOwner', Array)
#3 src/XF/Template/Templater.php(701): XF\Template\Templater->{closure}(Object(xenMade\SEo\XF\Template\Templater), Array, Array)
#4 internal_data/code_cache/templates/l1/s1/public/thread_view.php(648): XF\Template\Templater->callMacro('tckChangeConten...', 'menu_link_row', Array, Array)
#5 src/XF/Template/Templater.php(1315): XF\Template\Templater->{closure}(Object(xenMade\SEo\XF\Template\Templater), Array)
#6 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('thread_view', Array)
#7 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#8 src/XF/Mvc/Dispatcher.php(418): XF\Mvc\Renderer\Html->renderView('XF:Thread\\View', 'public:thread_v...', Array)
#9 src/XF/Mvc/Dispatcher.php(400): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#10 src/XF/Mvc/Dispatcher.php(360): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#11 src/XF/Mvc/Dispatcher.php(53): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#12 src/XF/App.php(2178): XF\Mvc\Dispatcher->run()
#13 src/XF.php(390): XF\App->run()
#14 index.php(20): XF::runApp('XF\\Pub\\App')
#15 {main}
I verified disabling Change Content Owner prevents/removes both errors.

This is pretty heinous since Change Content Owner wasn't even involved here.
 

batpool52!

Well-known member
Bug: If you edit a deleted users post you get the following error:
  • InvalidArgumentException: Column 'user_id' is read only, can only be set with forceSet
  • src/XF/Mvc/Entity/Entity.php:593
  • Generated by: Russ
  • Aug 13, 2019 at 3:39 PM
Stack trace
Code:
#0 src/addons/TickTackk/ChangeContentOwner/ChangeOwner/AbstractHandler.php(134): XF\Mvc\Entity\Entity->set('user_id', 0)
#1 src/addons/TickTackk/ChangeContentOwner/ChangeOwner/AbstractHandler.php(92): TickTackk\ChangeContentOwner\ChangeOwner\AbstractHandler->getFallbackOldOwner(Object(XFMG\XF\Entity\Post))
#2 src/addons/TickTackk/ChangeContentOwner/Service/Content/AbstractOwnerChanger.php(280): TickTackk\ChangeContentOwner\ChangeOwner\AbstractHandler->getOldOwner(Object(XFMG\XF\Entity\Post))
#3 src/addons/TickTackk/ChangeContentOwner/Service/Content/AbstractOwnerChanger.php(436): TickTackk\ChangeContentOwner\Service\Content\AbstractOwnerChanger->getOldOwner(Object(XFMG\XF\Entity\Post))
#4 src/addons/TickTackk/ChangeContentOwner/Service/Content/EditorTrait.php(63): TickTackk\ChangeContentOwner\Service\Content\AbstractOwnerChanger->apply()
#5 src/addons/TickTackk/ChangeContentOwner/ControllerPlugin/Content.php(117): TickTackk\ChangeContentOwner\XF\Service\Post\Editor->applyOwnerChanger()
#6 src/addons/TickTackk/ChangeContentOwner/XF/Pub/Controller/Post.php(56): TickTackk\ChangeContentOwner\ControllerPlugin\Content->extendEditorService(Object(XFMG\XF\Entity\Post), Object(TickTackk\ChangeContentOwner\XF\Service\Post\Editor), 'XF:Post')
#7 src/XF/Pub/Controller/Post.php(116): TickTackk\ChangeContentOwner\XF\Pub\Controller\Post->setupPostEdit(Object(XFMG\XF\Entity\Post))
#8 src/addons/xenMade/SEO/XF/Pub/Controller/Post.php(88): XF\Pub\Controller\Post->actionEdit(Object(XF\Mvc\ParameterBag))
#9 src/addons/TickTackk/ChangeContentOwner/XF/Pub/Controller/Post.php(68): xenMade\SEO\XF\Pub\Controller\Post->actionEdit(Object(XF\Mvc\ParameterBag))
#10 src/addons/EWR/Porta/Pub/Controller/Post.php(39): TickTackk\ChangeContentOwner\XF\Pub\Controller\Post->actionEdit(Object(XF\Mvc\ParameterBag))
#11 src/addons/Andy/InsertAttachment/XF/Pub/Controller/Post.php(17): EWR\Porta\Pub\Controller\Post->actionEdit(Object(XF\Mvc\ParameterBag))
#12 src/XF/Mvc/Dispatcher.php(321): Andy\InsertAttachment\XF\Pub\Controller\Post->actionEdit(Object(XF\Mvc\ParameterBag))
#13 src/XF/Mvc/Dispatcher.php(244): XF\Mvc\Dispatcher->dispatchClass('XF:Post', 'Edit', Object(XF\Mvc\RouteMatch), Object(Andy\ConvertToJpg\XF\Pub\Controller\Post), NULL)
#14 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(Andy\ConvertToJpg\XF\Pub\Controller\Post), NULL)
#15 src/XF/Mvc/Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#16 src/XF/App.php(2178): XF\Mvc\Dispatcher->run()
#17 src/XF.php(390): XF\App->run()
#18 index.php(20): XF::runApp('XF\\Pub\\App')
#19 {main}
Fixed for next release.

After which Content Owner spews errors for every request on your forum:
  • ErrorException: Template error: Method canChangeOwner is not callable on the given object (EWR\Porta\Entity\Thread)
  • src/XF/Template/Templater.php:994
  • Generated by: Unknown account
  • Aug 13, 2019 at 3:39 PM
Stack trace
Code:
#0 [internal function]: XF\Template\Templater->handleTemplateError(512, 'Method canChang...', '/home/dvcinfo1/...', 994, Array)
#1 src/XF/Template/Templater.php(994): trigger_error('Method canChang...', 512)
#2 internal_data/code_cache/templates/l1/s1/public/tckChangeContentOwner_macros.php(66): XF\Template\Templater->method(Object(EWR\Porta\Entity\Thread), 'canChangeOwner', Array)
#3 src/XF/Template/Templater.php(701): XF\Template\Templater->{closure}(Object(xenMade\SEo\XF\Template\Templater), Array, Array)
#4 internal_data/code_cache/templates/l1/s1/public/thread_view.php(648): XF\Template\Templater->callMacro('tckChangeConten...', 'menu_link_row', Array, Array)
#5 src/XF/Template/Templater.php(1315): XF\Template\Templater->{closure}(Object(xenMade\SEo\XF\Template\Templater), Array)
#6 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('thread_view', Array)
#7 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#8 src/XF/Mvc/Dispatcher.php(418): XF\Mvc\Renderer\Html->renderView('XF:Thread\\View', 'public:thread_v...', Array)
#9 src/XF/Mvc/Dispatcher.php(400): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#10 src/XF/Mvc/Dispatcher.php(360): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#11 src/XF/Mvc/Dispatcher.php(53): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#12 src/XF/App.php(2178): XF\Mvc\Dispatcher->run()
#13 src/XF.php(390): XF\App->run()
#14 index.php(20): XF::runApp('XF\\Pub\\App')
#15 {main}
I verified disabling Change Content Owner prevents/removes both errors.

This is pretty heinous since Change Content Owner wasn't even involved here.
I'm unable to reproduce this.
 

Opalium

New member
Hello there.

I have this add-on installed for my board. It works fine overall, but this error comes up occasionally in the server logs:
Code:
LogicException: Could not find repository 'XF\Repository\ProfilePostComment' for 'XF:ProfilePostComment' src/XF/Mvc/Entity/Manager.php:258

Stack trace
#0 src/XF/Mvc/Controller.php(849): XF\Mvc\Entity\Manager->getRepository('XF:ProfilePostC...')
#1 [internal function]: XF\Mvc\Controller->repository('XF:ProfilePostC...')
#2 src/XF/ControllerPlugin/AbstractPlugin.php(79): call_user_func_array(Array, Array)
#3 src/addons/TickTackk/ChangeContentOwner/ControllerPlugin/Content.php(97): XF\ControllerPlugin\AbstractPlugin->__call('repository', Array)
#4 src/addons/TickTackk/ChangeContentOwner/XF/Pub/Controller/ProfilePost.php(112): TickTackk\ChangeContentOwner\ControllerPlugin\Content->extendContentEditAction(Object(XF\Mvc\Reply\View), 'comment', 'XF:ProfilePostC...')
#5 src/XF/Mvc/Dispatcher.php(321): TickTackk\ChangeContentOwner\XF\Pub\Controller\ProfilePost->actionCommentsEdit(Object(XF\Mvc\ParameterBag))
#6 src/XF/Mvc/Dispatcher.php(244): XF\Mvc\Dispatcher->dispatchClass('XF:ProfilePost', 'Commentsedit', Object(XF\Mvc\RouteMatch), Object(TickTackk\ChangeContentOwner\XF\Pub\Controller\ProfilePost), NULL)
#7 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(TickTackk\ChangeContentOwner\XF\Pub\Controller\ProfilePost), NULL)
#8 src/XF/Mvc/Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#9 src/XF/App.php(2178): XF\Mvc\Dispatcher->run()
#10 src/XF.php(390): XF\App->run()
#11 index.php(20): XF::runApp('XF\\Pub\\App')
#12 {main}
Any ideas what could cause this?

Cheers.
~Opalium
 

Nirjonadda

Well-known member
@batpool52! Getting lot of Server error log.

Code:
ArgumentCountError: Too few arguments to function TickTackk\ChangeContentOwner\XF\ChangeOwner\Post::getBreadcrumbs(), 0 passed and exactly 1 expected src/addons/TickTackk/ChangeContentOwner/XF/ChangeOwner/Post.php:21

Generated by: apuvai Aug 20, 2019 at 9:21 AM

Stack trace

#0 [internal function]: TickTackk\ChangeContentOwner\XF\ChangeOwner\Post->getBreadcrumbs()
#1 src/addons/Siropu/AdsManager/Template/Ad.php(117): call_user_func(Array)
#2 src/addons/Siropu/AdsManager/Listener.php(27): Siropu\AdsManager\Template\Ad->__construct(Object(XF\Pub\App), Object(XF\Mvc\Reply\View))
#3 [internal function]: Siropu\AdsManager\Listener::templaterGlobalData(Object(XF\Pub\App), Array, Object(XF\Mvc\Reply\View))
#4 src/XF/Extension.php(67): call_user_func_array(Array, Array)
#5 src/XF/App.php(2648): XF\Extension->fire('templater_globa...', Array, NULL)
#6 src/XF/App.php(1916): XF\App->fire('templater_globa...', Array)
#7 src/XF/App.php(1794): XF\App->getGlobalTemplateData(Object(XF\Mvc\Reply\View))
#8 src/XF/Pub/App.php(435): XF\App->preRender(Object(XF\Mvc\Reply\View), 'html')
#9 src/XF/Mvc/Dispatcher.php(355): XF\Pub\App->preRender(Object(XF\Mvc\Reply\View), 'html')
#10 src/XF/Mvc/Dispatcher.php(53): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#11 src/XF/App.php(2178): XF\Mvc\Dispatcher->run()
#12 src/XF.php(390): XF\App->run()
#13 index.php(20): XF::runApp('XF\\Pub\\App')
#14 {main}

Request state

array(4) {
  ["url"] => string(18) "/posts/840985/edit"
  ["referrer"] => string(42) "/threads/29/page-178"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 

batpool52!

Well-known member
@batpool52! Getting lot of Server error log.

Code:
ArgumentCountError: Too few arguments to function TickTackk\ChangeContentOwner\XF\ChangeOwner\Post::getBreadcrumbs(), 0 passed and exactly 1 expected src/addons/TickTackk/ChangeContentOwner/XF/ChangeOwner/Post.php:21

Generated by: apuvai Aug 20, 2019 at 9:21 AM

Stack trace

#0 [internal function]: TickTackk\ChangeContentOwner\XF\ChangeOwner\Post->getBreadcrumbs()
#1 src/addons/Siropu/AdsManager/Template/Ad.php(117): call_user_func(Array)
#2 src/addons/Siropu/AdsManager/Listener.php(27): Siropu\AdsManager\Template\Ad->__construct(Object(XF\Pub\App), Object(XF\Mvc\Reply\View))
#3 [internal function]: Siropu\AdsManager\Listener::templaterGlobalData(Object(XF\Pub\App), Array, Object(XF\Mvc\Reply\View))
#4 src/XF/Extension.php(67): call_user_func_array(Array, Array)
#5 src/XF/App.php(2648): XF\Extension->fire('templater_globa...', Array, NULL)
#6 src/XF/App.php(1916): XF\App->fire('templater_globa...', Array)
#7 src/XF/App.php(1794): XF\App->getGlobalTemplateData(Object(XF\Mvc\Reply\View))
#8 src/XF/Pub/App.php(435): XF\App->preRender(Object(XF\Mvc\Reply\View), 'html')
#9 src/XF/Mvc/Dispatcher.php(355): XF\Pub\App->preRender(Object(XF\Mvc\Reply\View), 'html')
#10 src/XF/Mvc/Dispatcher.php(53): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#11 src/XF/App.php(2178): XF\Mvc\Dispatcher->run()
#12 src/XF.php(390): XF\App->run()
#13 index.php(20): XF::runApp('XF\\Pub\\App')
#14 {main}

Request state

array(4) {
  ["url"] => string(18) "/posts/840985/edit"
  ["referrer"] => string(42) "/threads/29/page-178"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
I'm unable to reproduce that error. Do you still get that error when ads manager add-on is disabled?
 
Top