I got this error, every time user likes. Code: Server Error Log Error Info ErrorException: Undefined variable: extra_data - library/OneSignal/Model/Alert.php:129 Generated By: ilumina007, A moment ago Stack Trace #0 /home/nginx/domains/domain.com/public/library/OneSignal/Model/Alert.php(129): XenForo_Application::handlePhpError(8, 'Undefined varia...', '/home/nginx/dom...', 129, Array) #1 /home/nginx/domains/domain.com/public/library/OneSignal/Model/Alert.php(30): OneSignal_Alert::sendAlert(394049, 703224, 'ilumina007', 'post', 3640673, 'like', Array) #2 /home/nginx/domains/domain.com/public/library/SV/DeadlockAvoidance/XenForo/Model/Alert.php(14): OneSignal_Model_Alert->alertUser(394049, 703224, 'ilumina007', 'post', 3640673, 'like', Array) #3 /home/nginx/domains/domain.com/public/library/bdAlerts/Model/Alert.php(36): SV_DeadlockAvoidance_XenForo_Model_Alert->alertUser(394049, 703224, 'ilumina007', 'post', 3640673, 'like', Array) #4 /home/nginx/domains/domain.com/public/library/bdAlerts/Model/Alert.php(250): bdAlerts_Model_Alert->alertUser(394049, 703224, 'ilumina007', 'post', 3640673, 'like', Array) #5 /home/nginx/domains/domain.com/public/library/bdAlerts/Model/Alert.php(80): bdAlerts_Model_Alert->_bdAlerts_alertUser(Array, true) #6 /home/nginx/domains/domain.com/public/library/bdAlerts/Listener.php(61): bdAlerts_Model_Alert->bdAlerts_sendPendingAlerts() #7 /home/nginx/domains/domain.com/public/library/XenForo/CodeEvent.php(90): bdAlerts_Listener::front_controller_post_view(Object(XenForo_FrontController), '{"templateHtml"...') #8 /home/nginx/domains/domain.com/public/library/XenForo/FrontController.php(183): XenForo_CodeEvent::fire('front_controlle...', Array) #9 /home/nginx/domains/domain.com/public/index.php(13): XenForo_FrontController->run() #10 {main} Request State array(3) { ["url"] => string(39) "https://www.domain.com/p/3640673/like" ["_GET"] => array(1) { ["/p/3640673/like"] => string(0) "" } ["_POST"] => array(4) { ["_xfRequestUri"] => string(41) "/t/threadtitle.276573/" ["_xfNoRedirect"] => string(1) "1" ["_xfToken"] => string(8) "********" ["_xfResponseType"] => string(4) "json" } } OneSignal Addon: https://theadminzone.com/resources/...h-notifications-now-with-simple-install.1069/
xfrocks @RoldanLT I can't access the add-on page but it's worth trying to disable that add-on and see if the error goes away.
RoldanLT @RoldanLT Relevant code from the addon: Code: if($extraData != null) { $content_response = "Reason: " . $extra_data; } $app_id = $options->os_pn_app_id; $auth_key = $options->os_pn_auth_key; $content = array( "en" => $content_response ); $headings = array( "en" => $options->boardTitle //this is the first line of the notice, example being: Site Notification or Site Alert or something. ); $fields = array( 'app_id' => $app_id, 'tags' => array(array("key"=>"uid","relation"=>"=","value"=>$alertUserId)), 'contents' => $content, 'url' => $url, 'headings' => $headings ); $fields = json_encode($fields); //print("\nJSON sent:\n"); //print($fields); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://onesignal.com/api/v1/notifications"); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Authorization: Basic ' . $auth_key)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HEADER, FALSE); curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $response = curl_exec($ch); curl_close($ch); //print($response); }
RoldanLT @RoldanLT With the recent addon. New error pop-ups: Code: Server Error Log Error Info ErrorException: Array to string conversion - library/OneSignal/Model/Alert.php:125 Generated By: user, 3 minutes ago Stack Trace #0 /library/OneSignal/Model/Alert.php(125): XenForo_Application::handlePhpError(8, 'Array to string...', '/home/nginx/dom...', 125, Array) #1 /library/OneSignal/Model/Alert.php(30): OneSignal_Alert::sendAlert(795589, 759619, 'user', 'post', 3569642, 'like', Array) #2 /library/SV/DeadlockAvoidance/XenForo/Model/Alert.php(14): OneSignal_Model_Alert->alertUser(795589, 759619, 'user', 'post', 3569642, 'like', Array) #3 /library/bdAlerts/Model/Alert.php(36): SV_DeadlockAvoidance_XenForo_Model_Alert->alertUser(795589, 759619, 'user', 'post', 3569642, 'like', Array) #4 /library/bdAlerts/Model/Alert.php(250): bdAlerts_Model_Alert->alertUser(795589, 759619, 'user', 'post', 3569642, 'like', Array) #5 /library/bdAlerts/Model/Alert.php(80): bdAlerts_Model_Alert->_bdAlerts_alertUser(Array, true) #6 /library/bdAlerts/Listener.php(61): bdAlerts_Model_Alert->bdAlerts_sendPendingAlerts() #7 /library/XenForo/CodeEvent.php(90): bdAlerts_Listener::front_controller_post_view(Object(XenForo_FrontController), '{"templateHtml"...') #8 /library/XenForo/FrontController.php(183): XenForo_CodeEvent::fire('front_controlle...', Array) #9 /index.php(13): XenForo_FrontController->run() #10 {main} Request State array(3) { ["url"] => string(39) "https://www.domain.com/p/3569642/like" ["_GET"] => array(1) { ["/p/3569642/like"] => string(0) "" } ["_POST"] => array(4) { ["_xfRequestUri"] => string(73) "/t/thread.272725/" ["_xfNoRedirect"] => string(1) "1" ["_xfToken"] => string(8) "********" ["_xfResponseType"] => string(4) "json" } }
This looks bad PHP: if($extraData != null) { $content_response = "Reason: " . $extra_data; } Should be... PHP: if($extraData != null) { $content_response = "Reason: " . $extraData; }
xfrocks @RoldanLT Thank you for the update. Please let us know when you get back to it and whether it still doesn't work properly.