[OzzModz] Force Users To Read Threads

[OzzModz] Force Users To Read Threads 2.0.9 Patch Level 2

No permission to download
Problem:

If a user has not approved the changed "terms and rules" option; this add-on doesn't work and the user cannot go to another page.

I am sure, it will only take a few minutes for you to fix this important conflict. But you still don't. It creates a huge problem for users.
 
FYI - This not a big problem because there is an easy work around. Delete / disable the force or restore the thread.
A forced thread was soft deleted causing members to receive a Server Error message because of a NULL issue with "node_id".

1699896143764blob.webp

ft1.webp

Code:
Server error log
[LIST]
[*]ErrorException: [E_WARNING] Attempt to read property "node_id" on null
[*]src/addons/xenMade/STFRT/XF/Pub/Controller/Forum.php:52
[*]Generated by: CJ
[*]Nov 13, 2023 at 7:43 PM
[/LIST]
[HEADING=2]Stack trace[/HEADING]
#0 src/addons/xenMade/STFRT/XF/Pub/Controller/Forum.php(52): XF::handlePhpError(2, '[E_WARNING] Att...', '/home/jeepcj/pu...', 52)
#1 src/addons/SV/StandardLib/XF/Pub/Controller/Forum.php(21): xenMade\STFRT\XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
#2 src/XF/Mvc/Dispatcher.php(352): SV\StandardLib\XF\Pub\Controller\Forum->actionForum(Object(XF\Mvc\ParameterBag))
#3 src/XF/Mvc/Dispatcher.php(259): XF\Mvc\Dispatcher->dispatchClass('XF:Forum', 'Forum', Object(XF\Mvc\RouteMatch), Object(EWR\Porta\Pub\Controller\Forum), Object(XF\Mvc\Reply\Reroute))
#4 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(EWR\Porta\Pub\Controller\Forum), Object(XF\Mvc\Reply\Reroute))
#5 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#6 src/XF/App.php(2487): XF\Mvc\Dispatcher->run()
#7 src/XF.php(524): XF\App->run()
#8 index.php(20): XF::runApp('XF\\Pub\\App')
#9 {main}
Code:
[HEADING=2]Request state[/HEADING]
array(4) {
  ["url"] => string(45) "/community/forums/threads-to-be-reviewed.168/"
  ["referrer"] => string(37) "https://jeep-cj.com/community/forums/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 
If a user has not approved the changed "terms and rules" option; this add-on doesn't work and the user cannot go to another page.
This is not a bug. The user must agree to them before interacting with other pages.
This rules agreement page cannot be overridden in the "correct" ways, only dirty tricks used for example in Force Rules Accept add-on. using them twice will break both add-ons
 
If the contract is renewed, the user must accept these rules again. If there is something mandatory to read at that time, you can't go to the rules acceptance page option, you can't go anywhere.

And if this is not a bug, what should we do to solve it?
 
If the contract is renewed, the user must accept these rules again. If there is something mandatory to read at that time, you can't go to the rules acceptance page option, you can't go anywhere.

And if this is not a bug, what should we do to solve it?
Ah, now I get it
It does not allow rules acceptance page when "View Global" forced thread option enabled

Sent you in DM a new build for a test
 
I don't think this is working.
Because the "all user groups" option is already selected.
However, unregistered are not redirected to the mandatory link.
 
I just checked mine by opening in an incognito window and it functioned correctly. You must use an incognito window so XF cannot read a saved cookie. User group: Any
You can see I'm not logged in.

reg4.webp
 
I am getting the following error when I try to access the STFRT add-on via the control panel (in the "Users" section, not the add-on section). This is with the latest version of the add-on, and XenForo 2.2.16 with the latest patch level.

An exception occurred: [InvalidArgumentException] Class xenMade\STFRT\Thread\View does not match formatter pattern %s\%s\View\%s in src/XF.php on line 1129



  1. XF::stringToClass() in src/XF/App.php at line 1667

  2. XF\App->XF\{closure}() in src/XF/Container.php at line 234

  3. XF\Container->create() in src/XF/Container.php at line 247

  4. XF\Container->XF\{closure}() in src/XF/Mvc/Renderer/AbstractRenderer.php at line 79

  5. XF\Mvc\Renderer\AbstractRenderer->createViewObject() in src/XF/Mvc/Renderer/AbstractRenderer.php at line 87

  6. XF\Mvc\Renderer\AbstractRenderer->renderViewObject() in src/XF/Mvc/Renderer/Html.php at line 47

  7. XF\Mvc\Renderer\Html->renderView() in src/XF/Mvc/Dispatcher.php at line 460

  8. XF\Mvc\Dispatcher->renderView() in src/XF/Mvc/Dispatcher.php at line 442

  9. XF\Mvc\Dispatcher->renderReply() in src/XF/Mvc/Dispatcher.php at line 402

  10. XF\Mvc\Dispatcher->render() in src/XF/Mvc/Dispatcher.php at line 60

  11. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2485

  12. XF\App->run() in src/XF.php at line 524

  13. XF::runApp() in admin.php at line 13

=============================

Also this error shows up in the error log in the Admin control panel:




  • nvalidArgumentException: Class xenMade\STFRT\Thread\View does not match formatter pattern %s\%s\View\%s

  • src/XF.php:1129



  • Generated by: gerryvz

  • Jun 17, 2024 at 11:44 AM



Stack trace​


#0 src/XF/App.php(1667): XF::stringToClass('xenMade\\STFRT\\T...', '%s\\%s\\View\\%s', 'Admin')
#1 src/XF/Container.php(234): XF\App->XF\{closure}('xenMade\\STFRT\\T...', Array, Object(XF\Container))
#2 src/XF/Container.php(247): XF\Container->create('view', 'xenMade\\STFRT\\T...', Array)
#3 src/XF/Mvc/Renderer/AbstractRenderer.php(79): XF\Container->XF\{closure}('xenMade\\STFRT\\T...', Array)
#4 src/XF/Mvc/Renderer/AbstractRenderer.php(87): XF\Mvc\Renderer\AbstractRenderer->createViewObject('xenMade\\STFRT\\T...', 'admin:stfrt_thr...', Array)
#5 src/XF/Mvc/Renderer/Html.php(47): XF\Mvc\Renderer\AbstractRenderer->renderViewObject('xenMade\\STFRT\\T...', 'admin:stfrt_thr...', Array)
#6 src/XF/Mvc/Dispatcher.php(460): XF\Mvc\Renderer\Html->renderView('xenMade\\STFRT\\T...', 'admin:stfrt_thr...', Array)
#7 src/XF/Mvc/Dispatcher.php(442): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#8 src/XF/Mvc/Dispatcher.php(402): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#9 src/XF/Mvc/Dispatcher.php(60): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#10 src/XF/App.php(2485): XF\Mvc\Dispatcher->run()
#11 src/XF.php(524): XF\App->run()
#12 admin.php(13): XF::runApp('XF\\Admin\\App')
#13 {main}



Request state​


array(4) {
["url"] => string(30) "/forums/admin.php?frt/threads/"
["referrer"] => string(63) "https://www.500eboard.co/forums/admin.php?force-agreement/terms"
["_GET"] => array(1) {
["frt/threads/"] => string(0) ""
}
["_POST"] => array(0) {
}
}
 
@gerryvz
Quick workaround fix for the above problem. Edit "src/addons/xenMade/STFRT/Admin/Controller/FrtThread.php", replace:
Code:
Line 22:
return $this->view('xenMade\STFRT\Thread\View', 'stfrt_thread_list', $viewParams);

With:
return $this->view('xenMade\STFRT\Thread\View:View', 'stfrt_thread_list', $viewParams);
Code:
Line 74:
return $this->view('xenMade\STFRT\Thread\Delete', 'stfrt_thread_delete', $viewParams);

with:
return $this->view('xenMade\STFRT\Thread\Delete:Delete', 'stfrt_thread_delete', $viewParams);
Code:
Line 93:
return $this->view('xenMade\STFRT\Thread\Reset', 'stfrt_thread_reset', $viewParams);

with:
return $this->view('xenMade\STFRT\Thread\Reset:Reset', 'stfrt_thread_reset', $viewParams);
Code:
Line 176:
return $this->view('xenMade\STFRT\Thread\Edit', 'stfrt_thread_edit', $viewParams);

with:
return $this->view('xenMade\STFRT\Thread\Edit:Edit', 'stfrt_thread_edit', $viewParams);
 
Back
Top Bottom