Alert Improvements by Xon

Alert Improvements by Xon 2.10.13

No permission to download
I sent out a mass alert from admincp and members said the content was"

Physics Forums | Science Articles, Homework Help, Discussion
You are already logged in. Please click here to return to the forum list.
 
@Xon, is it possible to add a new functionality to this add-on? Alerts automatically show without refreshing the page. I know there are some XF1 forums that do that (I'm not sure if they are using an add-on or if it was part of XF1.)

If that can't be added to this, could a new add-on be created to do that?
 
Hi,

Installed this last night and this morning my error log is full of:

Code:
Exception: Could not find class SV\AlertImprovements\XF\Entity\UserOption when attempting to extend XF\Entity\UserOption src/XF/Extension.php:174
Generated by: Unknown account May 14, 2020 at 9:33 AM
Stack trace
#0 src/XF/Mvc/Entity/Manager.php(53): XF\Extension->extendClass('XF\\Entity\\UserO...')
#1 src/XF/Mvc/Entity/Manager.php(721): XF\Mvc\Entity\Manager->getEntityClassName('XF:UserOption')
#2 src/XF/Repository/User.php(155): XF\Mvc\Entity\Manager->instantiateEntity('XF:UserOption', Array, Array)
#3 src/XF/Repository/User.php(152): XF\Repository\User->_hydrateGuestUserData(Array)
#4 src/XF/Repository/User.php(102): XF\Repository\User->_hydrateGuestUserData(Array)
#5 src/XF/Repository/User.php(31): XF\Repository\User->getGuestUser()
#6 src/XF/App.php(1773): XF\Repository\User->getVisitor(NULL, Array)
#7 src/XF/Pub/App.php(154): XF\App->getVisitorFromSession(Object(XF\Session\Session))
#8 src/XF/App.php(2180): XF\Pub\App->start(true)
#9 src/XF.php(391): XF\App->run()
#10 index.php(20): XF::runApp('XF\\Pub\\App')
#11 {main}
Request state
array(4) {
  ["url"] => string(1) "/"
  ["referrer"] => bool(false)
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}

I have probably done something stupid but I have no idea what it is. Please help, thanks.
 
Unfortunately this hasn't fixed the problem. Any idea what I'm doing wrong?

I uploaded the file. It extracted into Upload. I moved the contents of the js and src folders into js and src, then used the rebuild. We still get the errors.

edit: Uninstalling and reinstalling also does not fix the problem.
 
Last edited:
That file is in the redistributable zip;
addon-Xon-AlertImprovements-2.7.4.zip\upload\src\addons\SV\AlertImprovements\XF\Entity\UserOption.php

Can you check that php has read access to the files and the file ownership is correct?
 
That file is in the redistributable zip;
addon-Xon-AlertImprovements-2.7.4.zip\upload\src\addons\SV\AlertImprovements\XF\Entity\UserOption.php

Can you check that php has read access to the files and the file ownership is correct?

Thanks for your help. I think you might have identified the issue but I can't be sure because things were moved around yesterday and the problem miraculously resolved itself. I don't believe there was anything wrong with your add-on. I'm pretty sure it was me and my co-admin messing things up.

Our members love your add-on so thanks for that too.
 
@Xon

I notice a lot of the errors shown below when I have the addon enabled. Which seems to affect the loading of external images on the site, such as those hosted on imgur. I've no idea what the possible connection could be there, all I know is that I'll suddenly notice that some images aren't loading and then I look in the admin and see these errors happening at the same time. Which is the only reason I really care, because otherwise they don't seem to cause any problems. Putting aside that possible connection, though, can you just tell me what I should do to get rid of them? Thank you.


  • ErrorException: Push notification failure: {"success":false,"endpoint":{},"message":"cURL error 28: Resolving timed out after 10115 milliseconds (see http:\/\/curl.haxx.se\/libcurl\/c\/libcurl-errors.html)"}
  • src/XF/Error.php:75

  • Generated by: ...
  • 13 May 2020 at 1:50 AM

Stack trace

#0 src/XF.php(187): XF\Error->logError('Push notificati...', false)
#1 src/XF/Service/PushNotification.php(249): XF::logError('Push notificati...')
#2 src/XF/Service/PushNotification.php(167): XF\Service\PushNotification->handleResults(Array, Array)
#3 src/XF/Service/PusherTrait.php(182): XF\Service\PushNotification->sendNotifications()
#4 src/XF/Repository/UserAlert.php(147): XF\Service\Alert\Pusher->push()
#5 src/XF/Repository/UserAlert.php(111): XF\Repository\UserAlert->insertAlert(30, 2, '...', 'user', 30, 'from_admin', Array)
#6 src/XF/Job/UserAlert.php(45): XF\Repository\UserAlert->alert(Object(SV\ReportImprovements\XF\Entity\User), 2, '...', 'user', 30, 'from_admin', Array)
#7 src/XF/Job/AbstractUserCriteriaJob.php(59): XF\Job\UserAlert->executeAction(Object(SV\ReportImprovements\XF\Entity\User))
#8 src/XF/Job/Manager.php(253): XF\Job\AbstractUserCriteriaJob->run(G)
#9 src/XF/Job/Manager.php(195): XF\Job\Manager->runJobInternal(Array, G)
#10 src/XF/Job/Manager.php(111): XF\Job\Manager->runJobEntry(Array, G)
#11 src/XF/Admin/Controller/Tools.php(120): XF\Job\Manager->runByIds(Array, 120)
#12 src/XF/Mvc/Dispatcher.php(321): XF\Admin\Controller\Tools->actionRunJob(Object(XF\Mvc\ParameterBag))
#13 src/XF/Mvc/Dispatcher.php(244): XF\Mvc\Dispatcher->dispatchClass('XF:Tools', 'RunJob', Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\Tools), NULL)
#14 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\Tools), 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 admin.php(13): XF::runApp('XF\\Admin\\App')
#19 {main}

Request state

array(4) {
["url"] => string(24) "/admin.php?tools/run-job"
["referrer"] => string(141) "...?tools/run-job&only_ids=5278&_xfRedirect=https%3A%2F%2F...%2Fadmin.php%3Fusers%2Falert%26sent%3D2023"
["_GET"] => array(1) {
["tools/run-job"] => string(0) ""
}
["_POST"] => array(3) {
["_xfRedirect"] => string(53) "...?users/alert&sent=2023"
["_xfToken"] => string(8) "********"
["only_ids"] => string(4) "5278"
}
 
@imno007 that isn't something which this add-on causes. It may be that you are seeing it more often due to more alerts being generated depending on settings, but there isn't much I can do about it :(
 
@imno007 that isn't something which this add-on causes. It may be that you are seeing it more often due to more alerts being generated depending on settings, but there isn't much I can do about it :(

I'll likely have to leave it disabled then, I guess. Too bad. Thanks for the reply, though.
 
It seems like User Option to prevent marking as read when accessing /accounts/alerts page can by bypassed by tricking the user to access that page with skip_mark_read=0.
Is there anything that can be done to prevent this?
 
skip_mark_read flag and marking all alerts as reads if you touch /account/alerts is actually a feature of XF.

On a stock XenForo forum; if you hit /account/alerts?skip_mark_read=1 it will skip marking everything as read. This add-on just messes around the edges with it on the default value if the parameter is not present.

Fundamentally the issue is you can trivially trick a user's browser into touching /account/alerts via a [img] tag.

Hmm, but XF by itself does not have an option to not mark alerts read when accessing /accounts/alerts, this is only being added by your Add-on.
So how could this be an XF bug if this feature (not marking alerts read when accessing the page) does not exist in XF?
This looks to be migrated in XF2.2; https://xenforo.com/community/threa...tent-read-without-actually-reading-it.176773/
 
Last edited:
This Add-on does countain a bunch of *_(rated|liked)_x phrases, are those actually being used on XF 2.1 without your content ratings Add-on?
 
Top Bottom