Warning Improvements by Xon

Warning Improvements by Xon 2.2.8

No permission to download

sbj

Well-known member
PHP:
Server error log

    ErrorException: Template error: Method getUploadTraffic is not callable on the given object (SV\WarningImprovements\XF\Entity\User) src/XF/Template/Templater.php:935

    Generated by: Unknown account 27 November 2018 at 12:13

Stack trace

#0 [internal function]: XF\Template\Templater->handleTemplateError(512, 'Method getUploa...', '/home/nginx/dom...', 935, Array)
#1 src/XF/Template/Templater.php(935): trigger_error('Method getUploa...', 512)
#2 internal_data/code_cache/templates/l3/s2/public/PAGE_CONTAINER.php(1268): XF\Template\Templater->method(Object(SV\WarningImprovements\XF\Entity\User), 'getUploadTraffi...', Array)
#3 src/XF/Template/Templater.php(1249): XF\Template\Templater->{closure}(Object(AL\ThreadFilter\XF\Template\Templater), Array)
#4 src/addons/AL/ThreadFilter/XF/Template/Templater.php(108): XF\Template\Templater->renderTemplate('PAGE_CONTAINER', Array, true)
#5 src/XF/Pub/App.php(449): AL\ThreadFilter\XF\Template\Templater->renderTemplate('public:PAGE_CON...', Array)
#6 src/XF/App.php(1766): XF\Pub\App->renderPageHtml('\n\n<div class="b...', Array, Object(XF\Mvc\Reply\Error), Object(XF\Mvc\Renderer\Html))
#7 src/XF/Mvc/Dispatcher.php(310): XF\App->renderPage('\n\n<div class="b...', Object(XF\Mvc\Reply\Error), Object(XF\Mvc\Renderer\Html))
#8 src/XF/Mvc/Dispatcher.php(44): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\Error), 'html')
#9 src/XF/App.php(1931): XF\Mvc\Dispatcher->run()
#10 src/XF.php(328): XF\App->run()
#11 index.php(13): XF::runApp('XF\\Pub\\App')
#12 {main}

Request state

array(4) {
  ["url"] => string(25) "/robots.txt?1543310031733"
  ["referrer"] => bool(false)
  ["_GET"] => array(2) {
    ["/robots_txt"] => string(0) ""
    [1543310031733] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}

Not sure if this error is caused by this addon.
 

Xon

Well-known member
It isn't, that is something custom in your PAGE_CONTAINER template, adding a getUploadTraffic method.

It looks like you don't have a robots.txt file, so XF is answering it as a 404
 
  • Like
Reactions: sbj

sbj

Well-known member
How can I find out from where that method comes from?

And do I need a robots.txt file?
 

Xon

Well-known member
How can I find out from where that method comes from?
Start with Appearances => Search templates and plug in getUploadTraffic, and see if you get a template owned by an add-on. That may not show anything.

Then try Appearances => Template modifications => PAGE_CONTAINER, then inspect each to see if they have a reference to getUploadTraffic

And do I need a robots.txt file?
Not really, but putting one there means XenForo isn't server HTML when a crawler hits it.
 
  • Like
Reactions: sbj

sbj

Well-known member
I tried both of that before I asked you, but both delivered 0 results why I wanted to know if there is another short way. It doesn't find any method like that in my PAGE_CONTAINER. Anyhow, thank you. I'll see if I can find that method by scanning all files.
 

leebo

Member
In my warning list I seem to have a 'ghost warning'. It's warning ID is zero and it's title is warning_title.0 (which I'm unable to change). There's no option to delete it on the warning list page or the edit warning page.

If I may ask a favor,
I too am seeing this error and cannot for the life of me figure out how to edit this title. I’d like to edit the custom warning field to make it where Mods cannot alter the points but I’m not able as I can’t add a title. Any assistance would be awesome as I’m in love with this modification!
 

Xon

Well-known member
If I may ask a favor,
I too am seeing this error and cannot for the life of me figure out how to edit this title. I’d like to edit the custom warning field to make it where Mods cannot alter the points but I’m not able as I can’t add a title. Any assistance would be awesome as I’m in love with this modification!
Have you updated to the latest version? It should recreate those missing warning titles on updating or installing.
 

Xon

Well-known member

bctrainers

Member
When applying a warning, this is an error returned...

TypeError: Argument 1 passed to SV\WarningImprovements\XF\Repository\Warning::getSvWarningReplaceables() must be an instance of XF\Entity\User, instance of SV\WarningImprovements\XF\Entity\Warning given, called in /var/www/xf2/src/addons/SV/WarningImprovements/XF/Service/User/Warn.php on line 185 in src/addons/SV/WarningImprovements/XF/Repository/Warning.php at line 29
  1. SV\WarningImprovements\XF\Repository\Warning->getSvWarningReplaceables() insrc/addons/SV/WarningImprovements/XF/Service/User/Warn.php at line 185
  2. SV\WarningImprovements\XF\Service\User\Warn->setupConversation() insrc/XF/Service/User/Warn.php at line 205
  3. XF\Service\User\Warn->sendConversation() insrc/addons/SV/WarningImprovements/XF/Service/User/Warn.php at line 200
  4. SV\WarningImprovements\XF\Service\User\Warn->sendConversation() insrc/XF/Service/User/Warn.php at line 176
  5. XF\Service\User\Warn->_save() in src/addons/SV/WarningImprovements/XF/Service/User/Warn.php at line 76
  6. SV\WarningImprovements\XF\Service\User\Warn->_save() insrc/XF/Service/ValidateAndSavableTrait.php at line 40
  7. XF\Service\User\Warn->save() in src/XF/ControllerPlugin/Warn.php at line 41
  8. XF\ControllerPlugin\Warn->actionWarn() insrc/addons/SV/WarningImprovements/XF/ControllerPlugin/Warn.php at line 46
  9. SV\WarningImprovements\XF\ControllerPlugin\Warn->actionWarn() in src/XF/Pub/Controller/Post.phpat line 386
  10. XF\Pub\Controller\Post->actionWarn() in src/XF/Mvc/Dispatcher.php at line 321
  11. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 248
  12. XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 100
  13. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 50
  14. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2155
  15. XF\App->run() in src/XF.php at line 389
  16. XF::runApp() in index.php at line 20
Attached a screenshot of the options used. This is from upgrading to the 2.2.0 series from 2.1.14.
189733

FWIW, this is with XF 2.1 beta 3/4. Not sure if you're supporting 2.1.x series at this time.
 
  • Like
Reactions: Xon

limboclub

Active member
A bit of a strange one - the title on the thread posted for the user shows:

[User] warned 10 points for [Thread title]

The warning given is 0 points, but the user has a total of 10 points.

Where is the format of this thread title edited?
 

Xon

Well-known member
A bit of a strange one - the title on the thread posted for the user shows:

[User] warned 10 points for [Thread title]

The warning given is 0 points, but the user has a total of 10 points.

Where is the format of this thread title edited?
You want warning_points not points, all the replacables are;
  • title
  • content
  • url
  • user_id
  • name
  • username
  • staff
  • staff_user_id
  • points
  • report
  • date
  • notes
  • warning_title
  • warning_points
  • warning_category
  • threshold
  • warning_link
 

limboclub

Active member
You want warning_points not points, all the replacables are;
  • title
  • content
  • url
  • user_id
  • name
  • username
  • staff
  • staff_user_id
  • points
  • report
  • date
  • notes
  • warning_title
  • warning_points
  • warning_category
  • threshold
  • warning_link
That thread title - where is it set? It doesn't seem to be user editable via ACP Options.
 

Xon

Well-known member
That thread title - where is it set? It doesn't seem to be user editable via ACP Options.
You need to edit the phrases, either
  • Warning_Summary_Title
  • Warning_Summary_Message
or
  • Warning_Thread_Title
  • Warning_Thread_Message
Depending on exactly which notification method is being used.
 
Top