I have been using Sexybookmarks for some time on multiple sites and has worked great. Today I performed an Ubercart, Ubercart Discount coupons and CSS3PIE Module update. And now an error is showing up on my Nodes.

Notice: Undefined index: #bundle in sexybookmarks_entity_view() (line 110 of /yada/yada/sites/all/modules/sexybookmarks/includes/field_ui.inc

Not sure if something is overwriting this index from the ubercart module upgrade, but it started right after the other module upgrades today.

Comments

Norberto Ostallo’s picture

I have the same problem and this seems to happen if Ubercart cart block is active.

Norberto Ostallo’s picture

Status: Active » Needs review
StatusFileSize
new1.93 KB

Hi, I have written a patch to solve the problem, that simply checks if '#bundle' index is set before trying to access it.

whthat’s picture

the sexy patch works for me, thanks

MGParisi’s picture

Status: Needs review » Reviewed & tested by the community

Worked for me. The issue happened when I also installed Privatemsg

lionheart8’s picture

This seems to solve my problem of many weeks and was coming up on all pages with Media Gallery pictures and was posing a big problem.

Many thanks.

roborracle’s picture

Netbeans users, are you getting a "The patch cannot be applied in the selected context" errror? Tried nuermous different ways to apply, but kept running in to that error.

manoloka’s picture

I confirm that patch in #2 fixed my problem.

However as I had already patched the function sexybookmarks_entity_view to sort this issue #1237452: Wrong URL on mainpage, I now find myself with that problem again.

Any chance of get a patch for that function that sorts both issues?

Thanks
Manuel

manoloka’s picture

I have mixed up both patches (the one from #2 and the one from #1237452: Wrong URL on mainpage), everything seems to work fine, without those annoying Undefined index: #content in sexybookmarks_entity_view() warnings and sharing (on facebook) the proper url from lists views pages ...

However, right now, while testing, sometimes facebook is not getting the proper images (if any at all) titles and/or descriptions yet all the OG tags are giving the proper information therefore I assume it's a facebook problem.

Could someone confirm this?

/**
 * Implements hook_field_formatter_view().
 */

function sexybookmarks_entity_view($entity, $type, $view_mode, $langcode) {
  if (isset($entity->content['#bundle'])) {
    ctools_include('export');
    $profile = ctools_export_crud_load('sexybookmarks_profiles', variable_get("{$type}_sexybookmarks_profile_{$entity->content['#bundle']}", 'default'));
    if (!empty($profile)) {
      $uri = entity_uri($type, $entity);
      $entity->content['sexybookmarks'] = array(
        '#markup' => theme('sexybookmarks', array(
        'url' => url($uri['path'],  array('absolute' => TRUE)),
    //  'url' => isset($entity->uri['path']) ? url($entity->uri['path'], array('absolute' => TRUE)) : '',
          'title' => isset($entity->title) ? $entity->title : '',
          'profile' => $profile->name,
        )),
        '#weight' => 100,
      );
    } 
  }
}

I'm no programmer, just an amateur, sorry I don't know how to write a proper patch

Could someone with the skill to check this code out?

Thanks
Manuel

shareaholic’s picture

Issue summary: View changes

SexyBookmarks module is no longer being actively maintained. It was a port of Shareaholic for WordPress, and Shareaholic has since released an official Drupal module:

http://drupal.org/project/shareaholic

Please migrate to the official Shareaholic for Drupal module, which has updated buttons, styles, services, 100% mobile-ready and much more! You can learn more here: https://blog.shareaholic.com/drupal-module/

shareaholic’s picture

Version: 7.x-2.0 »
Status: Reviewed & tested by the community » Closed (fixed)