If I try to add an Action of any type and choose one from the select list the wheel spins for a bit then nothings happens. Trying a second time to choose from the select list does not produce the spinning wheel.

If I turn off jQuery Update it work as normal.

Files: 
CommentFileSizeAuthor
#37 rules-jquery_update_compatibility-1810656-37.patch1.67 KBmoonray
PASSED: [[SimpleTest]]: [MySQL] 351 pass(es).
[ View ]
#25 rules-1810656-25.patch2.56 KBpjcdawkins
PASSED: [[SimpleTest]]: [MySQL] 347 pass(es).
[ View ]
#17 rules-1810656-17.patch1.19 KBpjcdawkins
PASSED: [[SimpleTest]]: [MySQL] 347 pass(es).
[ View ]
#11 rules-1810656-11-do-not-test.patch1.04 KBpjcdawkins
#7 jquery_update_breaks_rules.PNG7.79 KBdeggertsen

Comments

Can confirm the same problem is this to with the .attr() problem with newer versions of jquery?

Version:7.x-2.2» 7.x-2.3

I can confirm that this is also an issue with the 2.3 branch of Rules.

However, unlike the jQuery Update conflicts that occurred with both the Features UI and the Views UI (which could be mitigated by selecting a different version of jQuery), the Rules UI is broken with jQuery version 1.5, 1.7, and 1.8, which makes this module pretty unusable in a site running the jQuery Update module.

Despite what is reported in #1792524: code error which causes adding new condition to not do anything when user clicks on "Continue" green button this does not appear to be affected by UUID.

To recreate the issue, install Rules and jQuery Update.

Then, attempt to add any event, condition, or action that requires any of the data selectors. The data selectors do not work.

Priority:Normal» Major

Any solutions?

Our solution was to not use Rules.

Bump

Marked http://drupal.org/node/1946162 as duplicate of this issue

StatusFileSize
new7.79 KB

No progress on this? I've attached a screenshot just for fun...

Does anybody have any idea where to start? I might try to fix this. I have to have both rules and jquery update so yeah...

For those wanting to roll back, jQuery Update commit baff5d1 is the last one that works with Rules. Data selectors, but not the initial drop-down menu for actions, works with jQuery Update commit 469fac0.

Here's what I'm getting in the console output in Chrome:

Uncaught TypeError: Object [object Object] has no method 'menu'
$.widget._create
(anonymous function)
$.Widget._createWidget
$.(anonymous function).(anonymous function)
(anonymous function)
jQuery.extend.each
jQuery.fn.jQuery.each
$.fn.(anonymous function)
Drupal.rules.autocomplete
(anonymous function)
jQuery.extend.each
jQuery.fn.jQuery.each
$.fn.once
Drupal.behaviors.rules_autocomplete.attach
(anonymous function)
jQuery.extend.each
Drupal.attachBehaviors
Drupal.ajax.commands.insert
Drupal.ajax.success
ajax.options.success
options.success
fire
self.fireWith
done
callback

And here's what I get in Firefox:

TypeError: $(...).addClass(...).appendTo(...).menu is not a function
if ( length > 1 ) {
  for ( ; i < length; i++ ) {
    if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) {
      args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) );
    } else {
      --count;
    }
  }
  if ( !count ) {
    deferred.resolveWith( deferred, args );
  }
}
TypeError: this.menu is undefined
_close: function( event ) {
  if ( this.menu.element.is( ":visible" ) ) {
    this.menu.element.hide();
    this.menu.blur();
    this.isNewMenu = true;
    this._trigger( "close", event );
  }
}

Does this help anyone? I don't understand javascript and jquery very well so it's Greek to me.

Status:Active» Needs work
StatusFileSize
new1.04 KB

I've marked the above mentioned issue (#1410978) as a duplicate of this one.

We could do with more debugging.

jQuery 1.8 is working OK with Rules for me, AFAICS, needing just a couple of tweaks for supporting jQuery UI >=1.10.

Here's the last patch I posted in that thread. It only applies for those running jQuery UI >=1.10. I suppose what we should do is make this patch work with or without, so it's backward/forward compatible.

See http://jqueryui.com/upgrade-guide/1.10/

Version:7.x-2.3» 7.x-2.x-dev
Component:Module Integrations» User Interface

Patches are against -dev of course.

ajax detect jquery version right, but not correct jquery ui version

must be like this

<?php
function jquery_update_library_alter(&$javascript, $module) {
//...
//...
 
if (!empty($admin_version) && path_is_admin(current_path())) {
    if (
version_compare($version, $admin_version, '!=')) {
     
$version = $admin_version;
    }
  }
 
// If the ajax version is set then that one always win.
 
if (!empty($_POST['ajax_page_state']['jquery_version'])) {
   
$ajax_version = $_POST['ajax_page_state']['jquery_version'];
    if (
in_array($ajax_version, array('1.5', '1.6', '1.7'))) {
     
$version = $ajax_version;
    }
  }
//...
//...
?>

please, test it
http://yadi.sk/d/j7Fjkm4O6Ubix

@ Punk_UnDeaD
I was thinking of a similar approach, but with an entry to the variables table.
Check out what jquery_update does now:

+------------------------------------+---------------+
| name                               | value         |
+------------------------------------+---------------+
| jquery_update_compression_type     | s:3:"min";    |
| jquery_update_jquery_admin_version | s:3:"1.7";    |
| jquery_update_jquery_cdn           | s:6:"google"; |
| jquery_update_jquery_version       | s:3:"1.5";    |
+------------------------------------+---------------+

... seems to me that all that is missing is jquery_update_jquery_ui_version
Modules could then do a simple variable_get and an if statement to check for compatibility.

Bringing to the jquery_update queue.
https://drupal.org/node/2034987

+++ b/ui/rules.autocomplete.jsundefined
@@ -105,12 +105,12 @@ Drupal.rules = Drupal.rules || {};
-    this.jqObject.data("autocomplete").close = function (event) {
+    this.jqObject.data("ui-autocomplete").close = function (event) {

Do the older jQuery versions already write into date-ui-autocomplete? Because if they don't, then these changes break backwards compatibility.

Status:Needs work» Needs review
StatusFileSize
new1.19 KB
PASSED: [[SimpleTest]]: [MySQL] 347 pass(es).
[ View ]

@fubhy, I don't think so, but that could be solved by something like this

Yep, that looks better.

Thanks - #17 looks good, any testers?

Status:Needs review» Needs work

Seems to only work when the admin jQuery is set to 1.5, 1.7, or "use the default" and when the default jQuery is set to 1.5 (which would unfortunately defeat the purpose of using jQuery Update).

With jQuery Update latest head, Rules latest head, and the patch in #17 applied:

Admin set to 1.8

  • Default: 1.8: add action drop-down works; data selector has button on right side, but doesn't autocomplete and clicking the button has no effect.
  • Default: 1.5, 1.7: add action drop-down doesn't work: If you select an action, the Ajax load indicator appears, but disappears without any change to the form after a a few seconds; data selector has button on right side, but doesn't autocomplete and clicking the button has no effect.

Admin set to 1.7

  • Default: 1.7, 1.8: add action drop-down works; data selector has button on right side, but doesn't autocomplete and clicking the button has no effect.
  • Default: 1.5 add action drop-down works; data selector works

Admin set to 1.5

  • Default: 1.7, 1.8: add action drop-down works; data selector renders as plain text field: no button, no autocomplete
  • Default: 1.5 add action drop-down works; data selector works

Admin set to "use default"

  • Default: 1.7, 1.8: add action drop-down works; data selector has button on right side, but doesn't autocomplete and clicking the button has no effect.
  • Default: 1.5 add action drop-down works; data selector works

Currently on the move so can't test but that surprises me as it works for me on a site with 1.8. Any JS console errors you can paste?

Applied the patch with the following results.

Default is set to 1.7 for everything below

Admin use default: Same results as #20

Admin 1.5: Everything works as expected so far! Thank you!

Admin 1.7: Same results as #20

Admin 1.8: Same results as #20

This is what shows up in the console when I have admin set to 1.8:

Uncaught TypeError: Object [object Object] has no method 'menu'
$.widget._create
(anonymous function)
$.Widget._createWidget
$.(anonymous function).(anonymous function)
(anonymous function)
jQuery.extend.each
jQuery.fn.jQuery.each
$.fn.(anonymous function)
Drupal.rules.autocomplete
(anonymous function)
jQuery.extend.each
jQuery.fn.jQuery.each
$.fn.once
Drupal.behaviors.rules_autocomplete.attach
(anonymous function)
jQuery.extend.each
Drupal.attachBehaviors
Drupal.theme.placeholder
fire
self.fireWith
jQuery.extend.ready
DOMContentLoaded

Error when data selector has button, but doesn't autocomplete (Admin 1.8/Default All; Admin 1.7, Use default/Default 1.7, 1.8):

[Error] TypeError: 'undefined' is not a function (evaluating '$( "<ul>" ) (undefined, line 201)
.addClass( "ui-autocomplete ui-front" )
.appendTo( this._appendTo() )
.menu')

Error when add action drop-down menu doesn't work (Admin 1.8/Default 1.5, 1.7):

[Error] TypeError: 'undefined' is not a function (evaluating '$('form.user-info-from-cookie').once') (undefined, line 65)

Error when data selector doesn't render (Admin 1.5/Default 1.7, 1.8):

[Error] TypeError: 'undefined' is not a function (evaluating 'this.element.prop( "disabled" )') (action, line 63)

Status:Needs work» Needs review
StatusFileSize
new2.56 KB
PASSED: [[SimpleTest]]: [MySQL] 347 pass(es).
[ View ]

Thanks. I've made some changes. Seems to have UI issues (the new jQuery UI Menu component has weird gaps between options, and keyboard access seems a bit broken), but I haven't had console errors which is an improvement.

Status:Needs review» Needs work

Awesome, it's getting there. Here are my results from the patch in #25:

Admin set to 1.8

  • Default: 1.8: add action drop-down works; data selector works but has the funky padding issue.
  • Default: 1.5, 1.7: no change: drop-down menu doesn't work, data selector renders but no autocomplete. Same errors as before.

Admin set to 1.7

  • Default: 1.7, 1.8: add action drop-down works; data selector works but has the funky padding issue.
  • Default: 1.5 no change: add action drop-down works; data selector works without any padding issue.

Admin set to 1.5

  • Default: 1.7, 1.8: no change: add action drop-down works; data selector renders as plain text field: no button, no autocomplete. Same errors as before.
  • Default: 1.5 no change: add action drop-down works; data selector works without any padding issue.

Admin set to "use default"

  • Default: 1.7, 1.8: add action drop-down works; data selector works but has the funky padding issue.
  • Default: 1.5 no change: add action drop-down works; data selector works without any padding issue.

I confirm #26 report about 1.8 - data selectors have jumping paddings. Patch from #25.

It doesn't work for me with the versions described in #20:
jQuery Update latest head, Rules latest head, and the patch in #17 applied. I've tried with all versions of jQuery.

Chrome still reports Uncaught TypeError: Cannot set property '_renderItem' of undefined

I've also uninstalled Search Autocomplete, and it still doesn't work.

Status:Needs work» Fixed

I found a solution for the problem I encountered, which is not exactly the same as the problems encountered in this thread.

I'm adding it here in case other people have this problem and can't find a proper solution. It can be quite difficult to find the core to the problem, when the error message is the exact same.

My problem is related to apachesolr_autocomplete, and there is a fix here: https://drupal.org/node/1491068

Status:Fixed» Needs work

which is not exactly the same as the problems encountered in this thread.

The why on earth would you say this issue is "fixed"? Reverting status.....

Confirming #29

Yes We are having the same issue and our conflict is also due to the apachesolr_autocomplete module ... this modules extends the jQuery autocomplete function which in turn conflicts with rules autocomplete functionality
the patch mentioned here https://drupal.org/node/1491068 fixes the issue for us ....

I get a completely different error when I try to select "Select the condition to add: Node is of type":
Uncaught TypeError: Cannot read property 'length' of undefined
Patch #25 doesn't solve that problem.
Using jQuery 1.5 for the admin.
Disabling jQuery Update solves the problem. Seems Rules and jQuery just don't work together.

I'm using:

  • Drupal: 7.23
  • Rules: latest 7.x-2.5+0-dev (3 oct) with patch #25 applied
  • jQuery Update: latest 7.x-2.3+7-dev
  • jQuery 1.8.2 and jQuery UI 1.10.2

With jQuery Update set to using CDN (google or microsoft):
Data selector works showing available items. Also autocomplete works.
The only problem is that I cannot make a selection from the items displayed in the combo box because as soon as I mouse the mouse or press an arrow key the popup combo closes.

With jQuery Update set to using CDN (jQuery): autocomplete doesn't work and no combo popup appears.

If I switch back to CDN = none: everything works fine again!

tried #23 and got the following error on chrome:

Uncaught TypeError: Object [object Object] has no method 'menu'
e.widget._create
(anonymous function)
e.Widget._createWidget
e.(anonymous function).(anonymous function)
(anonymous function)
p.extend.each jquery.min.js?v=1.8.2:2
p.fn.p.each jquery.min.js?v=1.8.2:2
e.fn.(anonymous function)
Drupal.rules.autocomplete
(anonymous function)
p.extend.each jquery.min.js?v=1.8.2:2
p.fn.p.each jquery.min.js?v=1.8.2:2
$.fn.once jquery.once.js?v=1.2:55
Drupal.behaviors.rules_autocomplete.attach
(anonymous function) drupal.js?mu5o20:76
p.extend.each jquery.min.js?v=1.8.2:2
Drupal.attachBehaviors drupal.js?mu5o20:74
Drupal.ajax.commands.insert ajax.js?v=7.23:542
Drupal.ajax.success ajax.js?v=7.23:400
ajax.options.success ajax.js?v=7.23:164
c.success jquery.form.min.js?v=2.69:11
k jquery.min.js?v=1.8.2:2
l.fireWith jquery.min.js?v=1.8.2:2
y jquery.min.js?v=1.8.2:2
d jquery.min.js?v=1.8.2:2

retried #33, works now thank you

#25 looks good but the menu addition shouldn't be done that way. It seems this is being done because of this bug in jquery_update #2086105: jQuery UI menu not including

I'm going to fix that bug now and instead if the rules.autocomplete depends on jquery autocomplete the menu.js should just be included by the dependency system.

Does this make sense?

StatusFileSize
new1.67 KB
PASSED: [[SimpleTest]]: [MySQL] 351 pass(es).
[ View ]

I rerolled the patch in #25 without the "jQuery UI menu not being included" fix; it's fixed in jQuery Update module, as per #36.

It seems #26 requires some additional tweaks to make this work for more use-cases than mine. This patch solved the issue for me, though.

-edit- my issue was caused by the clientside validation extension. The patch from #37 works.

Issue summary:View changes
Status:Needs work» Reviewed & tested by the community

Patch #37 works for me

Patch not working on the dev version of jQuery update module.

I still confirm that #37 doesn't work when using CDN.
Is there any way to fix it?

Status:Reviewed & tested by the community» Needs work

The patch works when using 1.5 of jquery update but breaks when using default. So this needs work...

Patch #37 works for me with version 1.10. In the data selectors it was spitting out the html markup and throwing the Cannot set property '_renderItem' of undefined error and that is now fixed.

Patch is not solving anything for me.

TypeError: this.jqObject.data(...) is undefined (line 111)
this.jqObject.data(autocompleteDataKey)._renderItem = function(ul, item) {

But I get the error even without JQuery update.
Latest Rules dev version
JQuery update 7.x-2.3

I disabled and deleted the JQuery update, but the problem is still there.

Patching Rules module with #37 along with installed jquery_update 7.x-2.3+15-dev (jQuery 1.10) makes Rules Add action form's JS rework!

Thanks!

Using

  • jQuery Update jQuery 1.5.2 and jQuery UI 1.8.7
  • Rules 7-2.6

The drop-down to use a condition works, but the Data selector field does not have autocomplete and the Data Selector list isn't a collapsed list, but just a word.
However after clicking on 'Save' without filling in a value for the data, I get the expected error message - and the autocomplete works and Data selector link is the collapsed table that it should be.

#37 patch appears to work for me so far with the latest dev version of jQuery update

Hello,

No need for any patch, if you have installed jquery update select version 1.7 also do not select any cdn (google), for cdn choose none, Problem is resolved. :)

Thanks,
Himanshu

Agree to #33 and 49.
Thanks !

But if you need CDN ... maybe you could disable it while u need to edit rules (at least you are not stuck during development)

confirm patch #37 works with jquery_update 7.x-2.3+15-dev (jquery 1.10) and rules 7.x-2.6

Yes. #37 works.
rules-7.x-2.6
jquery_update-7.x-2.3+15-dev

Status:Needs work» Needs review

I can NOT confirm #49! I've selected jQuery 1.7 for admin and the normal theme and the error is still there even after clearing caches.

First after applying patch #37 and clearing caches everything worked again.
I think we should move this forward and set it RTBC soon or do further investigations. It's major.

I'm using:
- Drupal 7.26
- jQuery Update 7.x-2.3+17-dev
- Rules 2.6

So:
- #37 patch works for me! Thanks a lot!
- #49 doesn't work :/

Hi guys, I am pretty new to Drupal and programming in general, so pleas bear with me... I got the data selector working by configuring the jQuery_update module:
Default JQuery Version: 1.7
Alternate JQuery Version: 1.7
JQuery Compression Level: Development (I doubt this should make any differences)
JQuery and JQuery UI CDN : JQuery

Hope this help!
Gino

The #55 work for me.
I think that its the JQuery UI CDN none value doesn't work.
Thanks for @ginogarcia.

Very strange: #55 works for me too.
Local or via Google cdn does not work.

#55 worked for me as well. I am using Jquery Update 7.x-2.4. Thanks!

#55 works for me too. Jquery update version = 7.x-2.4.
Thanks very much !