When sharethis is installed it cause AJAX paging in views to fail. This occurred using the frontpage view exposed by views 2. When sharethis was not installed paging worked correctly. Once sharethis was installed AJAX callbacks no longer worked correctly.

The issue does not occur in IE7 but does occur in FF.

Firebug flags the problem as occuring in line 30 ajax_views.js and gives the following error

ob.toString is not a function

Comments

marcingy’s picture

Version: 6.x-1.x-dev » 6.x-2.0-rc5
merlinofchaos’s picture

Status: Active » Postponed (maintainer needs more info)

That's odd. There is no ob.toString in ajax_view.js at all; line 30 in that file is this:

    Drupal.attachBehaviors($view.parent());
esmerel’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

No update for more than 30 days.

langelhc’s picture

Version: 6.x-2.0-rc5 » 7.x-3.7
Status: Closed (fixed) » Active

Maybe this issue should be posted in the ShareThis module, but I'll appreciate any idea,
The social icons disappear, when a navigate in the view with Ajax Pager, these were the steps I followed to config my site:

- Install the ShareThis module (7.x-2.5)
- Create a view to show all the nodes and I added the field 'ShareThis Link' to the view
- Active Ajax pager
- When I go to the view (the first time that the page is loaded, social icons appear)
- Go to the 2nd page, now you will see that the social icons disappear.

I found that if I run this in the console of the browser, the icons appear again:

  stLight.readyRun = false;
  stLight.onReady(); 

I tried to add it in myModule.js file but this is not working if I go to the 2nd page, but if I continue to the 3rd page here it works, the icons appear.

(function($) {
  Drupal.behaviors.myModule = {
    attach: function(context, settings) {
      stLight.readyRun = false;
      stLight.onReady(); 
    }
  }
})(jQuery);

Any comment will be appreciated.
Thnks.

langelhc’s picture

@edutrul send me this post: http://drupal.org/node/1197104#comment-6758302
This is what I did:

$.getScript("http://w.sharethis.com/button/buttons.js#publisher=" + share_publisher_id, function(){
  stLight.readyRun = false;
  stLight.onReady();
});
langelhc’s picture

Status: Active » Closed (fixed)

Works for me

dsudheesh’s picture

@langelhc

Thanks a lot for the fix.. this worked for me too...

dend01’s picture

I put the script by langelhc in the sharethis folder of my site:
sites/all/modules/sharethis/mymodule.js

I'm not sure where to put the call for the javascript file. I used this call:
drupal_add_js(drupal_get_path('module', 'mymodule') .'/mymodule.js');

and placed it in the sharethis.module file:

// Load the css and js for our module's configuration.
   drupal_add_css($my_path . '/ShareThisForm.css');
   drupal_add_js('https://ws.sharethis.com/share5x/js/stcommon.js', 'external');  //This is ShareThis's common library - has a serviceList of all the objects that are currently supported.
   drupal_add_js(drupal_get_path('module', 'mymodule') .'/mymodule.js');
   drupal_add_js($my_path . '/ShareThisForm.js');
   drupal_add_js($my_path . '/stlib_picker.js');
   drupal_add_css($my_path . '/stlib_picker.css');

But the buttons are still disappearing after about one hour (no matter what computer I am on).

I tried to also place a call in the sharethis.info file:
scripts[] = mymodule.js

But that doesn't seem to work either.

Any suggestions as to where the call for the javascript file needs to be located (and where in the file) would be greatly appreciated.