I am testing my product checkout with Ubercart, and after the order is submitted, I get the attached error messages complaining about my profiles for services I'm not using (I'm only using Facebook and Twitter).
I get a bunch of these messages:
Notice: Undefined index: widgets in socialmedia_tokens() (line 133 of /var/www/brc/sites/all/modules/socialmedia/socialmedia.tokens.inc).
Notice: Undefined index: widgets in socialmedia_tokens() (line 133 of /var/www/brc/sites/all/modules/socialmedia/socialmedia.tokens.inc).
along with a bunch of these:
You are trying to use a social media Flickr profile token but the profile has not been set. Set Flickr profile.
You are trying to use a social media Flickr profile token but the profile has not been set. Set Flickr profile.
You are trying to use a social media Google+ profile token but the profile has not been set. Set Google+ profile.
You are trying to use a social media Google+ profile token but the profile has not been set. Set Google+ profile.
I'm not using Google+, Flickr, and others (just FB and Twitter).
Comments
Comment #1
Demoshane CreditAttribution: Demoshane commentedYes, same for me. Maybe it is related somehow to ubercart? Its bit tricky as I need to show error messages to customers and this pops out every time someone places order, then customer calls to our customer service and asks if he's payment has arrived or not or are his bank details safe etc. I did temporary fix and disabled messages with css from order completition page.
Comment #2
nyleve101 CreditAttribution: nyleve101 commentedHi,
I'm also having this problem, did anyone manage to resolve it?
Hope all is well,
EVelyn
Comment #3
vosindia CreditAttribution: vosindia commentedHey Guys,
Its Very simple
Go to Home » Administration » Configuration » Media » Social media
then enter all the social media link and password to profile Tab, all error message will gone
Comment #4
aniebel CreditAttribution: aniebel commented@vosindia, suppose you only want to display Facebook and Twitter. Not everyone wants to show every single social media link.
Comment #5
rudymg24674 CreditAttribution: rudymg24674 commentedThere's another thread in this forums outlining the same problem. And I agree with Aniebel - not every company is going to possibly have login credentials for every single social media profile, in fact I highly doubt many people actually do use every single one listed in this module. For whatever reason, when we "uncheck" the boxes for the profiles we do not want to use for the site, ubercart is still somehow calling those tokens after checkout. I can only imagine that there is some sort of naming problem between the two modules, and whatever Ubercart does after checkout on the order confirmation page, is somehow calling the tokens for the social media module.
Comment #6
rudymg24674 CreditAttribution: rudymg24674 commenteddoes anyone have any idea on how we can start tackling this problem?? right now I'm using CSS to hide the error message, but that's obviously not the right way to go about doing this. I'm just about ready to pay someone to fix this problem, because overall I like the social media module - it's just this one conflict with ubercart checkout...
So if someone with more experience with module writing can lend a hand, let's see if we can crack this one...
Comment #7
vintorg CreditAttribution: vintorg commentedI can't believe this hasn't been touched.
Comment #8
aniebel CreditAttribution: aniebel commentedAn easy way to handle it is to turn off Configuration>Development>Logging & Errors but that would prevent you from seeing any others.
Comment #9
rudymg24674 CreditAttribution: rudymg24674 commentedyeah that's not really a solution - that's just like what I'm doing now, by using CSS to hide the error message... which isn't good because there are actual error messages that I do want them to see.
I don't know much about debuggin, and what not. I wish there was some program/plugin that I could run, so I could see every action and call that goes on during the checkout process. I know the answer is there, and I'm almost certain it's a similar naming issue...
Comment #10
rudymg24674 CreditAttribution: rudymg24674 commentedI asked for some help in the Ubercart forums - and this is the response that I got
Off the top of my head, the fix for this is to set something in the Social Media module that removes the tokens from global use when the profiles are deactivated.
Thoughts anyone??
Comment #11
rudymg24674 CreditAttribution: rudymg24674 commentedI posted this in the Ubercart forums to see if anyone with Devel experience on Ubercart can see the problem.
http://pastebin.com/k9F2peQb
I installed Devel - and ran through the checkout process again - down on line 479 of the pastebin - you will see that there are calls to load social media profiles, and it goes through all of them... This is the problem, clearly, I just don't know where/what is invoking this, or how to drill down to see it...
anyone with experience have any idea how I can pinpoint where/how this is being called?? All of the stuff on the top of the pastebin are expandable menues so if someone needs me to dig deeper into it I can.
Comment #12
rudymg24674 CreditAttribution: rudymg24674 commentedor is the other option for now, to just remove this "notice"?? until something gets fixed here??
Comment #13
rudymg24674 CreditAttribution: rudymg24674 commentedI commented out
and left everything else there - the entire if/else statement - doesn't resolve the underlying problem, but it's removed the messages from showing up... a workaround for now until I either find a new module, or someone decides to start maintaining this module again... and if not it really needs to have its status changed...
Comment #14
vintorg CreditAttribution: vintorg commentedYeah, it's totally on the social media side.
Comment #15
Dan Z CreditAttribution: Dan Z commentedYou know, instead of commenting out that whole mess, you might perhaps just replace it with
That way, if it got some unusable token for some unregistered site, the text would just be replaced with...itself. It would make sure the array got properly populated, too. This could avoid possible errors down the line.
It's an ugly hack, of course. It might create an infinitely recursive loop that would implode into a black hole that would suck in the entire solar system in a microsecond...or it might solve your problem neatly. Give it a try and see what happens.
Oh, and if you're having other errors after doing this, make sure to uninstall this module and see if the errors persist.
Comment #16
rudymg24674 CreditAttribution: rudymg24674 commentedhaha - Z-twist, I'll have to see how that manages.
See the problem is, I'm still fairly new at Drupal - I'm an extremely fast learner though - but from what I've been gathering, this module wasn't written properly with best practices. But it has so much potential... it's just a shame it's no longer being maintained.
It almost felt like an advertisement from Level Ten.
I'll have to give your suggestion a try - and in the mean time, I'm going to learn a bit about module development, and see if I can't determine the ACTUAL problem with this module.
Comment #17
TomDude48 CreditAttribution: TomDude48 commentedIf someone who is using Social media with Ubercart would like to submit a patch I would be happy to review it.
In the meantime, try removing the superfluous widgets from your widget sets. See http://drupal.org/node/1599114#comment-6279354 for direction.
Comment #18
livlogik CreditAttribution: livlogik commentedhas anyone found a fix for this? i keep getting this error everytime someone submits a order--->
"Notice: Undefined index: widgets in socialmedia_tokens() (line 144 of /home/content/50/9927750/html/sites/all/modules/socialmedia/socialmedia.tokens.inc)."
here is a SS attached.
Thanks :D
Comment #19
livlogik CreditAttribution: livlogik commentedHey guys! i just wanted to let you know i go a fix for this.
I have a screenshot attached but here is what i did.
i hope this was helpful please let me know if it works for everyone else.
-LivLogik
Comment #20
earthangelconsulting CreditAttribution: earthangelconsulting commentedi found out a solution before i even found this thread, and here it is:
1) make sure that JUST THE WIDGETS YOU ARE USING have usernames and URLs filled in, as in #19 above, doesn't have to be the ones you aren't using at all.
2) if you aren't using the 'user' and 'site' versions of the tokens provided by this module, just disable them entirely. I did this by commenting out a few lines in socialmedia.tokens.inc (basically anything that refers to $tokens['site'] or $tokens['user']).
Why is this related to Ubercart? because Ubercart order generation does something non-standard (but not generally harmful) with tokens: in function template_preprocess_uc_order (the theme preprocess for template uc-order--customer.tpl), all tokens in groups 'site' and 'user' are evaluated ahead of time, so that they can be presented as variables for use within the template (as opposed to running the template result through the token substituter afterwards). and something about how it evaluates the social media subset of 'site' or 'user' is just wonky. it's possible it might not even work properly even if Ubercart was using tokens normally, that i am not sure of.
ONE of these modules might have done something that wasn't best-practice regarding how to properly implement a subset of a token group, and without further digging, I am not going to go out on a limb and say which module it was :-)
anyhow, if you get those lines out of the socialmedia module then all will be well, and you can still use the tokens from set 'socialmedia' if you want.
though really (hint to maintainer, if you are listening?), you should be able to entirely disable the tokens provided by this module, that's just extra overhead if you aren't using them.