[Liam W.] Title Permission Strings

[Liam W.] Title Permission Strings 2.1.1

No permission to download

Liam W

in memoriam 1998-2020
Liam W submitted a new resource:

Title Permission Strings - Criteria based access to threads with words in the title...

This powerful add-on allows you to create 'Title permission strings', which, when included in a thread title, limit access to that thread based on the user criteria system.

The ability to add permission strings to threads is permission controlled, and you can choose whether a permission string blocks the user from viewing a thread, or just from replying. Each permission string has its own error message defined, which is displayed to the visitor when they try and access a thread they do not...
Read more about this resource...
 

Rhodium

Active member
When i try to move messages inside a thread i get this error:

Code:
ErrorException: [E_WARNING] Invalid argument supplied for foreach() src/addons/LiamW/TitlePermissionStrings/XF/Entity/Thread.php:18
Generado por: Rhodium 12 May 2019 a las 12:10
Seguimiento
#0 src/addons/LiamW/TitlePermissionStrings/XF/Entity/Thread.php(18): XF::handlePhpError(2, '[E_WARNING] Inv...', '/home/foropl/pu...', 18, Array)
#1 src/XF/Mvc/Entity/Entity.php(768): LiamW\TitlePermissionStrings\XF\Entity\Thread->verifyTitle('Las cenobita ca...', 'title', 5, Array)
#2 src/XF/Mvc/Entity/Entity.php(613): XF\Mvc\Entity\Entity->_verifyValueCustom('Las cenobita ca...', 'title', 5, Array)
#3 src/XF/Mvc/Entity/Entity.php(548): XF\Mvc\Entity\Entity->set('title', 'Las cenobita ca...')
#4 src/XF/InlineMod/Post/AbstractMoveCopy.php(163): XF\Mvc\Entity\Entity->__set('title', 'Las cenobita ca...')
#5 src/XF/InlineMod/Post/Move.php(23): XF\InlineMod\Post\AbstractMoveCopy->getTargetThreadFromOptions(Array)
#6 src/XF/InlineMod/AbstractAction.php(80): XF\InlineMod\Post\Move->applyInternal(Object(XF\Mvc\Entity\ArrayCollection), Array)
#7 src/XF/Pub/Controller/InlineMod.php(131): XF\InlineMod\AbstractAction->apply(Object(XF\Mvc\Entity\ArrayCollection), Array)
#8 src/addons/Siropu/AdsManager/XF/Pub/Controller/InlineMod.php(54): XF\Pub\Controller\InlineMod->actionPerform()
#9 src/XF/Mvc/Dispatcher.php(321): Siropu\AdsManager\XF\Pub\Controller\InlineMod->actionPerform(Object(XF\Mvc\ParameterBag))
#10 src/XF/Mvc/Dispatcher.php(244): XF\Mvc\Dispatcher->dispatchClass('XF:InlineMod', 'Perform', Object(XF\Mvc\RouteMatch), Object(Siropu\AdsManager\XF\Pub\Controller\InlineMod), Object(XF\Mvc\Reply\Reroute))
#11 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(Siropu\AdsManager\XF\Pub\Controller\InlineMod), Object(XF\Mvc\Reply\Reroute))
#12 src/XF/Mvc/Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#13 src/XF/App.php(2177): XF\Mvc\Dispatcher->run()
#14 src/XF.php(390): XF\App->run()
#15 index.php(20): XF::runApp('XF\\Pub\\App')
#16 {main}
Code:
ErrorException: [E_NOTICE] Trying to get property 'liamw_title_permission_strings' of non-object src/addons/LiamW/TitlePermissionStrings/XF/Entity/Thread.php:16
Generado por: Rhodium 12 May 2019 a las 12:10
Seguimiento
#0 src/addons/LiamW/TitlePermissionStrings/XF/Entity/Thread.php(16): XF::handlePhpError(8, '[E_NOTICE] Tryi...', '/home/foropl/pu...', 16, Array)
#1 src/XF/Mvc/Entity/Entity.php(768): LiamW\TitlePermissionStrings\XF\Entity\Thread->verifyTitle('Las cenobita ca...', 'title', 5, Array)
#2 src/XF/Mvc/Entity/Entity.php(613): XF\Mvc\Entity\Entity->_verifyValueCustom('Las cenobita ca...', 'title', 5, Array)
#3 src/XF/Mvc/Entity/Entity.php(548): XF\Mvc\Entity\Entity->set('title', 'Las cenobita ca...')
#4 src/XF/InlineMod/Post/AbstractMoveCopy.php(163): XF\Mvc\Entity\Entity->__set('title', 'Las cenobita ca...')
#5 src/XF/InlineMod/Post/Move.php(23): XF\InlineMod\Post\AbstractMoveCopy->getTargetThreadFromOptions(Array)
#6 src/XF/InlineMod/AbstractAction.php(80): XF\InlineMod\Post\Move->applyInternal(Object(XF\Mvc\Entity\ArrayCollection), Array)
#7 src/XF/Pub/Controller/InlineMod.php(131): XF\InlineMod\AbstractAction->apply(Object(XF\Mvc\Entity\ArrayCollection), Array)
#8 src/addons/Siropu/AdsManager/XF/Pub/Controller/InlineMod.php(54): XF\Pub\Controller\InlineMod->actionPerform()
#9 src/XF/Mvc/Dispatcher.php(321): Siropu\AdsManager\XF\Pub\Controller\InlineMod->actionPerform(Object(XF\Mvc\ParameterBag))
#10 src/XF/Mvc/Dispatcher.php(244): XF\Mvc\Dispatcher->dispatchClass('XF:InlineMod', 'Perform', Object(XF\Mvc\RouteMatch), Object(Siropu\AdsManager\XF\Pub\Controller\InlineMod), Object(XF\Mvc\Reply\Reroute))
#11 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(Siropu\AdsManager\XF\Pub\Controller\InlineMod), Object(XF\Mvc\Reply\Reroute))
#12 src/XF/Mvc/Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#13 src/XF/App.php(2177): XF\Mvc\Dispatcher->run()
#14 src/XF.php(390): XF\App->run()
#15 index.php(20): XF::runApp('XF\\Pub\\App')
#16 {main}
 

Vitor Dos Reis

Active member
Database Error trying to save an existing string from XF1:
XF\Db\Exception: MySQL statement prepare error [1054]: Unknown column 'liamw_titlepermissionstrings_title_permission_string_cache' in 'field list' in src/XF/Db/AbstractStatement.php at line 217
  1. XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 196
  2. XF\Db\Mysqli\Statement->getException() in src/XF/Db/Mysqli/Statement.php at line 39
  3. XF\Db\Mysqli\Statement->prepare() in src/XF/Db/Mysqli/Statement.php at line 54
  4. XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 94
  5. XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 326
  6. XF\Db\AbstractAdapter->update() in src/XF/Mvc/Entity/Entity.php at line 1457
  7. XF\Mvc\Entity\Entity->_saveToSource() in src/XF/Mvc/Entity/Entity.php at line 1184
  8. XF\Mvc\Entity\Entity->save() in src/XF/Mvc/Entity/Entity.php at line 1254
  9. XF\Mvc\Entity\Entity->saveIfChanged() insrc/addons/LiamW/TitlePermissionStrings/Repository/ForumTitlePermissionString.php at line 28
  10. LiamW\TitlePermissionStrings\Repository\ForumTitlePermissionString->updateAssociationCache() insrc/addons/LiamW/TitlePermissionStrings/Repository/AbstractTitlePermissionStringMap.php at line 164
  11. LiamW\TitlePermissionStrings\Repository\AbstractTitlePermissionStringMap->rebuildContentAssociationCache() insrc/addons/LiamW/TitlePermissionStrings/Repository/AbstractTitlePermissionStringMap.php at line 73
  12. LiamW\TitlePermissionStrings\Repository\AbstractTitlePermissionStringMap->updateStringAssociations() insrc/addons/LiamW/TitlePermissionStrings/Admin/Controller/ThreadTitlePermissionString.php at line 63
  13. LiamW\TitlePermissionStrings\Admin\Controller\ThreadTitlePermissionString->LiamW\TitlePermissionStrings\Admin\Controller\{closure}() in src/XF/Mvc/FormAction.php at line 197
  14. XF\Mvc\FormAction->run() insrc/addons/LiamW/TitlePermissionStrings/Admin/Controller/AbstractTitlePermissionString.php at line122
  15. LiamW\TitlePermissionStrings\Admin\Controller\AbstractTitlePermissionString->actionSave() insrc/XF/Mvc/Dispatcher.php at line 321
  16. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 248
  17. XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 100
  18. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 50
  19. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2177
  20. XF\App->run() in src/XF.php at line 390
  21. XF::runApp() in admin.php at line 13
 

Vitor Dos Reis

Active member
Hello,

It's just me or it's impossible, in threads with strings, to edit the first post, move threads or post a reply with attachments? With users who have the correct condition (let's say as example user with 5000 posts and string +10posts).
"Title permission strings have been used in your thread, but you do not have permission to use them. Please remove them."

Don't understand if was just in my community or if we are the only one using this addon. :confused:

Thanks!
 

anon666

Member
I have a problem with my administrator user, which has zero messages. When I add a restriction by number of messages, my admin user cannot access the thread either.
 

Vitor Dos Reis

Active member
What the difference between "General permissions - Use title permission string" and "Forum moderator permissions - Use thread title permission strings"?

How can I use any of them?

Thanks
 

Liam W

in memoriam 1998-2020
What the difference between "General permissions - Use title permission string" and "Forum moderator permissions - Use thread title permission strings"?
The one under general permissions covers general use of permission strings accross all content types (the add-on is implemented in such a way that permission strings can be added to additional content types without too much code duplication). It is also the permission that is used when setting per-string permissions.

The Forum permission is a per-node permission, and can be used to control who can Thread title permissions specifically, on a per-node basis.

A user needs to have both effectively granted for permission strings to be used.

Liam
 

anon666

Member
I'm getting a lot of bugs in the admin panel, and the forum becomes unusable. I'm going to test the add-on today in my test forum, without any other plugin installed, and then I report the results.
 

anon666

Member
I have numerous "Server error log" of the type:

Server error log
TypeError: Argument 1 passed to XF::asVisitor() must be an instance of XF\Entity\User, null given, called in /mypath/upload/src/addons/LiamW/TitlePermissionStrings/XF/Entity/Thread.php on line 46 src/XF.php:472
Generated by: kemao Oct 16, 2019 at 12:07 AM

Stack trace
#0 src/addons/LiamW/TitlePermissionStrings/XF/Entity/Thread.php(46): XF::asVisitor(NULL, Object(Closure))
#1 src/XF/Widget/NewPosts.php(89): LiamW\TitlePermissionStrings\XF\Entity\Thread->canView()
#2 internal_data/code_cache/widgets/_7_forum_overview_new_posts.php(5): XF\Widget\NewPosts->render()
#3 src/XF/Template/Templater.php(6672): XF\SubContainer\Widget->{closure}(Object(XF\Template\Templater), Array, Array)
#4 src/XF/SubContainer/Widget.php(168): XF\Template\Templater->renderWidgetClosure(Object(Closure), Array)
#5 src/XF/Template/Templater.php(1634): XF\SubContainer\Widget->getCompiledWidget(Array, Array)
#6 internal_data/code_cache/templates/l2/s2/public/forum_list.php(206): XF\Template\Templater->widgetPosition('forum_list_side...', Array)
#7 src/XF/Template/Templater.php(1315): XF\Template\Templater->{closure}(Object(XF\Template\Templater), Array)
#8 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('forum_list', Array)
#9 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#10 src/XF/Mvc/Dispatcher.php(418): XF\Mvc\Renderer\Html->renderView('XF:Forum\\Listin...', 'public:forum_li...', Array)
#11 src/XF/Mvc/Dispatcher.php(400): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#12 src/XF/Mvc/Dispatcher.php(360): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#13 src/XF/Mvc/Dispatcher.php(53): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#14 src/XF/App.php(2178): XF\Mvc\Dispatcher->run()
#15 src/XF.php(390): XF\App->run()
#16 index.php(20): XF::runApp('XF\\Pub\\App')
#17 {main}

Request state
array(4) {
["url"] => string(18) "/index.php?forums/"
["referrer"] => string(33) "https://myurl/index.php"
["_GET"] => array(1) {
["forums/"] => string(0) ""
}
["_POST"] => array(0) {
}
}

But only in nodes/forums with many threads (more than 4000).
In nodes/forums with few threads these errors are not shown.
 

Vitor Dos Reis

Active member
Hello @Liam W

A lot of errors after update XF to last version (2.1.7):

Code:
TypeError: Argument 1 passed to XF::asVisitor() must be an instance of XF\Entity\User, null given, called in /home/ourportal/webapps/app-ourportal/foruns/src/addons/LiamW/TitlePermissionStrings/XF/Entity/Thread.php on line 46 src/XF.php:473
Generated by: userbing12 Jan 29, 2020 at 10:13 PM
Stack trace
#0 src/addons/LiamW/TitlePermissionStrings/XF/Entity/Thread.php(46): XF::asVisitor(NULL, Object(Closure))
#1 src/XF/FindNew/Thread.php(137): LiamW\TitlePermissionStrings\XF\Entity\Thread->canView()
#2 [internal function]: XF\FindNew\Thread->XF\FindNew\{closure}(Object(EWR\Atendo\Entity\Thread))
#3 src/XF/Mvc/Entity/AbstractCollection.php(189): array_filter(Array, Object(Closure))
#4 src/XF/FindNew/Thread.php(138): XF\Mvc\Entity\AbstractCollection->filter(Object(Closure))
#5 src/XF/FindNew/Thread.php(111): XF\FindNew\Thread->filterResults(Object(XF\Mvc\Entity\ArrayCollection))
#6 src/XF/ControllerPlugin/FindNew.php(63): XF\FindNew\Thread->getResultIds(Array, '200')
#7 src/XF/Pub/Controller/AbstractWhatsNewFindType.php(72): XF\ControllerPlugin\FindNew->runFindNewSearch(Object(XF\FindNew\Thread), Array)
#8 src/XF/Pub/Controller/AbstractWhatsNewFindType.php(28): XF\Pub\Controller\AbstractWhatsNewFindType->triggerNewFindNewAction(Object(XF\FindNew\Thread), Array)
#9 src/XF/Mvc/Dispatcher.php(350): XF\Pub\Controller\AbstractWhatsNewFindType->actionIndex(Object(XF\Mvc\ParameterBag))
#10 src/XF/Mvc/Dispatcher.php(261): XF\Mvc\Dispatcher->dispatchClass('XF:WhatsNewPost', 'Index', Object(XF\Mvc\RouteMatch), Object(XF\Pub\Controller\WhatsNewPost), NULL)
#11 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XF\Pub\Controller\WhatsNewPost), NULL)
#12 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#13 src/XF/App.php(2184): XF\Mvc\Dispatcher->run()
#14 src/XF.php(391): XF\App->run()
#15 index.php(20): XF::runApp('XF\\Pub\\App')
#16 {main}
Request state
array(4) {
  ["url"] => string(34) "/forums/index.php?whats-new/posts/"
  ["referrer"] => string(55) "https://ourportal.com/forums/index.php?whats-new/"
  ["_GET"] => array(1) {
    ["whats-new/posts/"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}
Thanks! Best, Vitor
 
Top