conflict with Views Bulk Operations in latest version?

btully - December 21, 2007 - 20:55
Project:Hovertips and Clicktips
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

using the latest version of hovertip seems to have introduced a conflict with Views Bulk Operations. when selecting checkboxes and selecting a bulk operation and submitting one of two errors occurs:

1. the form appears to get submitted, but instead of getting processed the view gets reloaded. no error messages.

2. the form gets submitted, but the following error appears: "An illegal choice has been detected. Please contact the site administrator."

anyone else seeing this problem?

The previous version of hovertip did not have this issue. The difference seems to be in the way hovertip_init() is called and the fact that the settings are called via an external URL, which, while the menu callback is specified not to cache, seems to have introduced some cache problems.

here is the difference in code I'm using:

// ORIGINAL HOVERTIPS

function _hovertip_init() {
  drupal_add_css(drupal_get_path('module', 'hovertip').'/hovertip.css');
  drupal_add_js(drupal_get_path('module', 'hovertip') . '/hovertip.js');
  drupal_add_js(_hovertip_get_javascript(), 'inline');
}


// NEW (INCOMPATIBLE?) HOVERTIPS

function _hovertip_init() {
  drupal_add_css(drupal_get_path('module', 'hovertip').'/hovertip.css');
  drupal_add_js(drupal_get_path('module', 'hovertip') . '/hovertip.js');
  drupal_add_js('?q=hovertip/settings_js');
}

function hovertip_settings_js() {
  drupal_set_header('Content-Type: text/javascript');
  print(_hovertip_get_javascript());
  return;
}

#1

sociotech - March 29, 2008 - 05:42

We were having a different, though related problem with Hovertips.

For us, the problem was SSL. We had users who were getting browser warnings about unauthenticated content in the ssl portions of our site because of the "?q=hovertip/settings_js" url.

We had to get things fixed immediately, so as a quick workaround we put the settings_js javascript in a file (settings.js) in the module directory and added it using the same drupal_add_js style as used for hovertips.js.

This took care of our problem, but of course it disables the ability to change the javascript through the admin interface (not an issue for us). It'd be nice to have it fixed correctly.

#2

NathanRAFT - April 21, 2008 - 18:38

We had a similar problem with js aggregation not working due to a conflict with the drupal_add_js('?q=hovertip/settings_js');. The original code above works fine though. Any reason not to revert to that method?

#3

NathanRAFT - April 21, 2008 - 18:41

Will create a new big for this one.

#4

Dave Cohen - May 9, 2008 - 22:09
Status:active» fixed

http://drupal.org/node/249430

I'm hoping that fix resolves this issue as well. Thanks everyone.

#5

Anonymous (not verified) - May 23, 2008 - 22:11
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.