• Register
    • Help

    striker  0 Items
    Currently Supporting
    • Home
    • News
    • Forum
    • Wiki
    • Support
      • Manage Subscriptions
      • FAQ
      • Support For
        • VaultWiki 4.x Series
        • VaultWiki.org Site
    • What's New?
    • Buy Now
    • Manual
    • 
    • Support
    • VaultWiki 4.x Series
    • Bug
    • Comment bug/ maybe related to Pushbullet

    1. Welcome to VaultWiki.org, home of the wiki add-on for vBulletin and XenForo!

      VaultWiki allows your existing forum users to collaborate on creating and managing a site's content pages. VaultWiki is a fully-featured and fully-supported wiki solution for vBulletin and XenForo.

      The VaultWiki Team encourages you to join our community of forum administrators and check out VaultWiki for yourself.

    Issue: Comment bug/ maybe related to Pushbullet

    • Issue Tools
      • View Changes
    1. issueid=4242 February 26, 2015 3:57 PM
      matth2 matth2 is offline
      New Member
      Comment bug/ maybe related to Pushbullet
      Noticed this error several times:

      Code:
      Argument 1 passed to bdPushover_Helper_Alert::_getMessageFromTemplate() must be an instance of bdPushover_Simulation_Template, null given, called in /home/mario/public_html/saverocity.com/public/forum/library/bdPushover/Helper/Alert.php on line 281 and defined
      Yesterday at 3:41 PM - library/bdPushover/Helper/Alert.php:328
      Delete...
      Argument 1 passed to bdPushover_Helper_Alert::_getMessageFromTemplate() must be an instance of bdPushover_Simulation_Template, null given, called in /home/mario/public_html/saverocity.com/public/forum/library/bdPushover/Helper/Alert.php on line 281 and defined
      Monday at 7:03 PM - library/bdPushover/Helper/Alert.php:328
      They both relate to Wiki Comments.
    Issue Details
    Issue Number 4242
    Issue Type Bug
    Project VaultWiki 4.x Series
    Category Unknown
    Status Not a Bug
    Priority 2 - Fatal / Database Errors
    Affected Version 4.0.1
    Fixed Version (none)
    Milestone (none)
    Software DependencyXenForo 1.x
    License TypePaid
    Users able to reproduce bug 0
    Users unable to reproduce bug 0
    Attachments 0
    Assigned Users (none)
    Tags (none)




    1. February 26, 2015 9:27 PM
      pegasus pegasus is offline
      VaultWiki Team
      Why do you think they are related to wiki comments? What is the stack trace for one of them?
      Reply Reply  
    2. March 4, 2015 1:53 PM
      matth2 matth2 is offline
      New Member
      I deleted that one, but here is a new one that made me think it was:
      Code:
      ErrorException: Argument 1 passed to bdPushover_Helper_Alert::_getMessageFromTemplate() must be an instance of bdPushover_Simulation_Template, null given, called in /home/mario/public_html/saverocity.com/public/forum/library/bdPushover/Helper/Alert.php on line 281 and defined - library/bdPushover/Helper/Alert.php:328
      Generated By: MilesJunkie, Feb 25, 2015
      Stack Trace
      #0 /home/mario/public_html/saverocity.com/public/forum/library/bdPushover/Helper/Alert.php(328): XenForo_Application::handlePhpError(4096, 'Argument 1 pass...', '/home/mario/pub...', 328, Array)
      #1 /home/mario/public_html/saverocity.com/public/forum/library/bdPushover/Helper/Alert.php(281): bdPushover_Helper_Alert::_getMessageFromTemplate(NULL, Array, Array)
      #2 /home/mario/public_html/saverocity.com/public/forum/library/bdPushover/Helper/Alert.php(166): bdPushover_Helper_Alert::work2_send(Array)
      #3 /home/mario/public_html/saverocity.com/public/forum/library/bdPushover/Listener.php(40): bdPushover_Helper_Alert::work()
      #4 [internal function]: bdPushover_Listener::front_controller_post_view(Object(XenForo_FrontController), '{"templateHtml"...')
      #5 /home/mario/public_html/saverocity.com/public/forum/library/XenForo/CodeEvent.php(90): call_user_func_array(Array, Array)
      #6 /home/mario/public_html/saverocity.com/public/forum/library/XenForo/FrontController.php(179): XenForo_CodeEvent::fire('front_controlle...', Array)
      #7 /home/mario/public_html/saverocity.com/public/forum/index.php(13): XenForo_FrontController->run()
      #8 {main}
      Request State
      array(3) {
        ["url"] => string(65) "https://saverocity.com/forum/wiki_index/GoBank?action=postcomment"
        ["_GET"] => array(1) {
          ["action"] => string(11) "postcomment"
        }
        ["_POST"] => array(12) {
          ["quickreply_html"] => string(237) "..."
          ["_xfRelativeResolver"] => string(46) "https://saverocity.com/forum/wiki_index/GoBank"
          ["do"] => string(8) "comments"
          ["action"] => string(11) "postcomment"
          ["fromquickreply"] => string(1) "1"
          ["discussionid"] => string(1) "8"
          ["last_date"] => string(10) "1424736229"
          ["last_known_date"] => string(10) "1424896825"
          ["_xfToken"] => string(8) "********"
          ["_xfRequestUri"] => string(24) "/forum/wiki_index/GoBank"
          ["_xfNoRedirect"] => string(1) "1"
          ["_xfResponseType"] => string(4) "json"
        }
      }
      Reply Reply  
    3. March 4, 2015 2:33 PM
      pegasus pegasus is offline
      VaultWiki Team
      The only way I can see this happening is if there are no alerts left to send when Pushover tries to send them out. This is actually perfectly normal under default XenForo operation (although should be a very rare occurrence unless something weird is going on).

      In bdPushover/Helper/Alert.php, I see:
      Code:
      		$alerts = array($alert['alert_id'] => $alert);
      
      		$alerts = self::_getAlertModel()->bdPushover_getContentForAlerts($alerts, $assoc['user_id'], $assoc);
      
      		$alerts = self::_getAlertModel()->prepareAlerts($alerts, $assoc);
      
      		$handlers = self::_getAlertModel()->bdPushover_getHandlerCache();
      
      		$alerts = XenForo_ViewPublic_Helper_Alert::getTemplates($view, $alerts, $handlers);
      		$alertNew = array_pop($alerts);
      
      		$template = $alertNew['template'];
      Let me go over this line-by-line so you can report the bug to the developer of [bd] Pushover. This is the ONLY way I can see this happening without throwing a Fatal Error in step 5.

      1. $alerts is defined as an array containing 1 entry which is the alert we are trying to push.
      2. ::_getContentForAlerts tries to set a 'content' field for each entry in $alerts. According to the definition of the original method, it will remove any entries from $alerts if one of the following is true:
        • The content that sent the alert can't be found (maybe it was deleted already)
        • The user doesn't have permission to see the content that sent the alert (alerts for conversations and threads filter this way). Maybe it's moderated, maybe they are ignoring the poster, who knows.

        Thus, if ::_getContentForAlerts removes the 1 entry from step 1, we have an empty array.
      3. Process any additional data needed for entries in $alerts. If there are none, nothing happens.
      4. Get the registered handlers for content types that might send alerts.
      5. Using the registered handlers, cycle through $alerts and create a 'template' field for every single entry. The function that sets this field always returns a template object (even if the template it refers to doesn't exist). Thus, for all entries in $alerts, the 'template' field is created, and it will never be NULL. If there is an entry but no handler for that entry's content type, a fatal error will be thrown (call to ::renderHtml on a non-object).
      6. Get the last entry in $alerts, since it's likely the newest. According to array_pop: if there are no entries, false is returned.
      7. Get the field 'template' from that entry. We cannot get any fields if we got false before; in this case, a warning is logged and $template = NULL.

      In order to fix this bug, Pushover needs to change this:
      Code:
      		$alertNew = array_pop($alerts);
      
      		$template = $alertNew['template'];
      To this:
      Code:
      		$alertNew = array_pop($alerts);
      
      		if (!$alertNew)
      		{
      			return false;
      		}
      
      		$template = $alertNew['template'];
      Everywhere that calls ::work1_prepare then needs to check that it returns a valid alert before sending it to the queue (since it might return false now). Example:
      Code:
      $templateQueue[] = self::work1_prepare($queued[0], $queued[1]);
      Should be changed to:
      Code:
      $prepared = self::work1_prepare($queued[0], $queued[1]);
      
      if ($prepared)
      {
      	$templateQueue[] = $prepared;
      }
      Even if you noticed this bug due to VaultWiki or due to a related bug in VaultWiki, the errors you have quoted point to the bug I've described in Pushover. For our purposes here, I'm marking this as Not a Bug.
      Reply Reply  
    + Reply

    Assigned Users
    Loading Please Wait
    Tags
    Loading Please Wait
    • Contact Us
    • License Agreement
    • Privacy
    • Terms
    • Top
    All times are GMT -4. The time now is 2:32 PM.
    This site uses cookies to help personalize content, to tailor your experience, and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Learn more… Accept Remind me later
  • striker
    Powered by vBulletin® Version 4.2.5 Beta 2
    Copyright © 2023 vBulletin Solutions Inc. All rights reserved.
    Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2023 DragonByte Technologies Ltd.
    Copyright © 2008 - 2013 VaultWiki Team, Cracked Egg Studios, LLC.