I was receiving the illegal offset type in __widgets_error() warning that is described in bug #1468030: Warning: Illegal offset type in _widgets_error(). Upon further investigation I discovered the error occurred when the module is replacing tokens with associated text in the socialmedia_tokens() function. No profile is being loaded when the social media widget is set to display elements with the site wide profile which invokes the widgets_error() function.

The logic in the site context if statement of the socialmedia_tokens() function is incorrect because it states: If the type is 'socialmedia' AND the user profile is set but does not exist. The should be: if the type is 'socialmedia' Or the user profile is set but does not exist. Fixing the logic loads the profile and the site context tokens gets replaced correctly and the illegal offset type warning. I also split the line into 3 to make it more human readable.

The patch is attached for review and testing.

CommentFileSizeAuthor
sitecontext-1.patch887 bytesllslim
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Ben Coleman’s picture

We just installed Social media, and were getting those errors. This patch fixes the warnings, and the warnings don't come back after flushing caches (as reported for #1468030: Warning: Illegal offset type in _widgets_error()). I have *not* installed the patch in #1468030: Warning: Illegal offset type in _widgets_error().