[CinVin] Gravatar Tweaks [Deleted]

CinVin

Member
CinVin submitted a new resource:

CinVin: Gravatar Tweaks - Add additional options for Gravatar avatars

This add-on for XenForo 2 is to enable additional options for Gravatar avatars.

Gravatar URL - Override the URL used to server the Gravatar images. By default with XF 2.x the URL is https://secure.gravatar.com/avatar/ - Changing this value will change that to the URL of your choice. See this thread at the XF support forums for...

Read more about this resource...
 
Receiving this error…
Code:
ErrorException: [E_NOTICE] Undefined offset: 1 src/addons/CinVin/GravatarTweaks/XF/Entity/User.php:89
Generated by: DudeThatsErin Feb 25, 2022 at 9:41 PM

Stack Trace
Code:
#0 src/addons/CinVin/GravatarTweaks/XF/Entity/User.php(89): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/home/codinghel...', 89, Array)
#1 src/XF/Pub/View/Account/AvatarUpdate.php(23): CinVin\GravatarTweaks\XF\Entity\User->getGravatarUrl('m')
#2 src/XF/Mvc/Renderer/AbstractRenderer.php(91): XF\Pub\View\Account\AvatarUpdate->renderJson()
#3 src/XF/Mvc/Renderer/Json.php(65): XF\Mvc\Renderer\AbstractRenderer->renderViewObject('XF:Account\\Avat...', '', Array)
#4 src/XF/Mvc/Dispatcher.php(460): XF\Mvc\Renderer\Json->renderView('XF:Account\\Avat...', '', Array)
#5 src/XF/Mvc/Dispatcher.php(442): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Json), Object(XF\Mvc\Reply\View))
#6 src/XF/Mvc/Dispatcher.php(402): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Json), Object(XF\Mvc\Reply\View))
#7 src/XF/Mvc/Dispatcher.php(60): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'json')
#8 src/XF/App.php(2351): XF\Mvc\Dispatcher->run()
#9 src/XF.php(517): XF\App->run()
#10 index.php(20): XF::runApp('XF\\Pub\\App')
#11 {main}

Request State
Code:
array(4) {
  ["url"] => string(15) "/account/avatar"
  ["referrer"] => string(49) "https://domainjunkie.site/account/account-details"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(8) {
    ["_xfToken"] => string(8) "********"
    ["avatar_crop_x"] => string(1) "0"
    ["avatar_crop_y"] => string(1) "0"
    ["use_custom"] => string(17) "th_avatar_gallery"
    ["th_avatar_gallery_avatar_id"] => string(3) "109"
    ["_xfRequestUri"] => string(24) "/account/account-details"
    ["_xfWithData"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}

I know this is in beta so that’s why I’m reporting this. :)
 
Good to know about the beta.

I haven’t tried using it myself so I’m not sure why this error occurred in the first place. I installed it, activated, and I’m using Ozzy’s avatar gallery for my account myself on my forum. It may have popped up when I went to set my avatar after installing both addons. So, I would have just looked at the page with my account details but not used gravatar.
 
What value are you trying for the alternate Gravatar URL? I'll try to recreate the error.


This one will remain 'beta', I don't use Gravatar anywhere so it's one of the few add-ons I'll ever release that I don't actually use myself.
I have the same problem, never happened before, or at least i think it is similar.

Alternate identicons currently use, but tried using another one and still the same thing.

[E_NOTICE] Undefined offset: 1

  • ErrorException: [E_NOTICE] Undefined offset: 1
  • src/addons/CinVin/GravatarTweaks/XF/Entity/User.php:89
Stack Trace
#0 src/addons/CinVin/GravatarTweaks/XF/Entity/User.php(89): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/home/******/...', 89, Array) #1 src/XF/Entity/User.php(128): CinVin\GravatarTweaks\XF\Entity\User->getGravatarUrl('s') #2 src/XF/Entity/User.php(1914): XF\Entity\User->getAvatarUrl('s', NULL, true) #3 src/XF/Mvc/Entity/Entity.php(542): XF\Entity\User->setupApiResultData(Object(XF\Api\Result\EntityResult), 1, Array) #4 src/XF/Api/Result/EntityResult.php(192): XF\Mvc\Entity\Entity->toApiResult(1, Array) #5 src/XF/Api/Result/EntityResult.php(162): XF\Api\Result\EntityResult->castToFinalValue(Object(SV\DailyStatistics\XF\Entity\User), 1, Array) #6 src/XF/Api/Result/EntityResults.php(120): XF\Api\Result\EntityResult->render() #7 src/XF/Api/Mvc/Renderer/Api.php(129): XF\Api\Result\EntityResults->render() #8 src/XF/Api/Mvc/Renderer/Api.php(111): XF\Api\Mvc\Renderer\Api->renderApiResultInternal(Array) #9 src/XF/Api/Mvc/Dispatcher.php(73): XF\Api\Mvc\Renderer\Api->renderApiResult(Object(XF\Api\Result\ArrayResult)) #10 src/XF/Mvc/Dispatcher.php(402): XF\Api\Mvc\Dispatcher->renderReply(Object(XF\Api\Mvc\Renderer\Api), Object(XF\Api\Mvc\Reply\ApiResult)) #11 src/XF/Mvc/Dispatcher.php(60): XF\Mvc\Dispatcher->render(Object(XF\Api\Mvc\Reply\ApiResult), 'api') #12 src/XF/App.php(2353): XF\Mvc\Dispatcher->run() #13 src/XF.php(524): XF\App->run() #14 index.php(16): XF::runApp('XF\\Api\\App') #15 {main}

Request State
array(4) { ["url"] => string(86) "/api/threads?thread_type=discussion&last_days=9999&order=last_post_date&direction=desc" ["referrer"] => string(114) "https://www.****.com/api/threads?thread_type=discussion&last_days=9999&order=last_post_date&direction=desc" ["_GET"] => array(4) { ["thread_type"] => string(10) "discussion" ["last_days"] => string(4) "9999" ["order"] => string(14) "last_post_date" ["direction"] => string(4) "desc" } ["_POST"] => array(0) { } }
 
What's the URL of the Gravatar server you're using so I can try to duplicate the error?
Just got the error again, I don't understand anything since gravatar support is OFF.

  • ErrorException: [E_NOTICE] Undefined offset: 1
  • src/addons/CinVin/GravatarTweaks/XF/Entity/User.php:89
  • Generated by: Unknown account
  • Nov 22, 2022 at 5:54 AM

Stack trace​

Code:
#0 src/addons/CinVin/GravatarTweaks/XF/Entity/User.php(89): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/home/****/...', 89, Array)
#1 src/XF/Entity/User.php(128): CinVin\GravatarTweaks\XF\Entity\User->getGravatarUrl('s')
#2 src/XF/Entity/User.php(1914): XF\Entity\User->getAvatarUrl('s', NULL, true)
#3 src/XF/Mvc/Entity/Entity.php(542): XF\Entity\User->setupApiResultData(Object(XF\Api\Result\EntityResult), 1, Array)
#4 src/XF/Api/Result/EntityResult.php(192): XF\Mvc\Entity\Entity->toApiResult(1, Array)
#5 src/XF/Api/Result/EntityResult.php(162): XF\Api\Result\EntityResult->castToFinalValue(Object(SV\DailyStatistics\XF\Entity\User), 1, Array)
#6 src/XF/Api/Result/EntityResults.php(120): XF\Api\Result\EntityResult->render()
#7 src/XF/Api/Mvc/Renderer/Api.php(129): XF\Api\Result\EntityResults->render()
#8 src/XF/Api/Mvc/Renderer/Api.php(111): XF\Api\Mvc\Renderer\Api->renderApiResultInternal(Array)
#9 src/XF/Api/Mvc/Dispatcher.php(73): XF\Api\Mvc\Renderer\Api->renderApiResult(Object(XF\Api\Result\ArrayResult))
#10 src/XF/Mvc/Dispatcher.php(402): XF\Api\Mvc\Dispatcher->renderReply(Object(XF\Api\Mvc\Renderer\Api), Object(XF\Api\Mvc\Reply\ApiResult))
#11 src/XF/Mvc/Dispatcher.php(60): XF\Mvc\Dispatcher->render(Object(XF\Api\Mvc\Reply\ApiResult), 'api')
#12 src/XF/App.php(2353): XF\Mvc\Dispatcher->run()
#13 src/XF.php(524): XF\App->run()
#14 index.php(16): XF::runApp('XF\\Api\\App')
#15 {main}

Request state​


Code:
array(4) {
  ["url"] => string(86) "/api/threads?thread_type=discussion&last_days=9999&order=last_post_date&direction=desc"
  ["referrer"] => string(114) "https://www.****.com/api/threads?thread_type=discussion&last_days=9999&order=last_post_date&direction=desc"
  ["_GET"] => array(4) {
    ["thread_type"] => string(10) "discussion"
    ["last_days"] => string(4) "9999"
    ["order"] => string(14) "last_post_date"
    ["direction"] => string(4) "desc"
  }
  ["_POST"] => array(0) {
  }
}
 
Hi again @Kevin,

I have been investigating and I have found the culprit of this happening.

At least I know who is causing the error, since it occurs when my WordPress blog is accessed where there is a widget that shows the latest themes created, there when loading the avatars, is when this error is reproduced.

The plugin is this: https://xenforo.com/community/resources/xfcoder-latest-xf-threads-widget-for-wordpress.8644/

What I don't know is why this happens, I hope it helps you. So far that's what I was able to find out. But I can't stop it from reproducing. I'll keep digging deeper until I can at least silence the bug.

Likewise, perhaps it is possible to reproduce it from the forum itself in some way, but from the blog the error always appears.

Regards
 
Just got the error again, I don't understand anything since gravatar support is OFF.
I have been investigating and I have found the culprit of this happening.
Thanks, your findings certainly saved me from a lot of digging around. 😎 I don't think I would've tracked it down to that WP add-on since I'm not using it.

Would you be able to try something.... if you turn on your gravatar support, disable this CinVin add-on, enable the WP add-on, and then make sure that a thread that is listed in the widget is for a user that has a Gravatar avatar selected, what happens? Do you see the normal Gravatar image in the WP widget and/or do you get an error yet logged in XF? If you don't get an error then it means that the error is definitely with the CinVin add-on and is something I'll try to track down when time permits but if you still get an error then it means that the WP add-on to display the widget isn't handling the Gravatar avatars being returned from the XF API.

EDIT: Never mind, found another issue with the CinVin add-on when changing avatars. Until I have a chance to work on it I'd suggest disabling the CinVin add-on.
 
Last edited:
Thanks, your findings certainly saved me from a lot of digging around. 😎 I don't think I would've tracked it down to that WP add-on since I'm not using it.

Would you be able to try something.... if you turn on your gravatar support, disable this CinVin add-on, enable the WP add-on, and then make sure that a thread that is listed in the widget is for a user that has a Gravatar avatar selected, what happens? Do you see the normal Gravatar image in the WP widget and/or do you get an error yet logged in XF? If you don't get an error then it means that the error is definitely with the CinVin add-on and is something I'll try to track down when time permits but if you still get an error then it means that the WP add-on to display the widget isn't handling the Gravatar avatars being returned from the XF API.

EDIT: Never mind, found another issue with the CinVin add-on when changing avatars. Until I have a chance to work on it I'd suggest disabling the CinVin add-on.
I have to tell you that it is a problem with the CinVin plugin, all that you have told me is the first thing I did. The error only goes away when the CinVin plugin is disabled.

If you need me to perform any other tests, please let me know, thank you very much for your help.

Regards
 
@javilonas please try the "1.0.2 A" release just posted; that should take care of the immediate issue you were having.
Thank you very much, it no longer reproduces any errors.

Happy I Love You GIF by Warner Bros. Deutschland


Regards
 
Back
Top Bottom