warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in /home/net2comm/domains/dev6/promis/includes/database.mysqli.inc on line 323.
user warning: Duplicate entry 'views_bulk_operations_ruleset_action' for key 1 query: INSERT INTO actions (aid, type, callback, parameters, description) VALUES ('views_bulk_operations_ruleset_action', '', '', '', '') in /home/net2comm/domains/dev6/promis/includes/actions.inc on line 276.
warning: preg_match() expects parameter 2 to be string, array given in /home/net2comm/domains/dev6/promis/includes/bootstrap.inc on line 771.

Comments

bsnodgrass’s picture

Other info:
Drupal. 6.10, Views 6.x-2.3

infojunkie’s picture

Assigned: Unassigned » infojunkie

Thanks for your report. I'll be investigating this. In the meantime you can just rename the rules.action.inc file to rules.action.bug or delete it altogether if you want to proceed with using VBO.

bsnodgrass’s picture

thanks!

infojunkie’s picture

To help me debug this, can you please also tell me what version of Rules you are using? And what's the list of Rulesets that you've created? Thanks.

bsnodgrass’s picture

Using rules 6.x-1.0-beta5
We have note yet established any rulesets

infojunkie’s picture

Not sure what caused this error to be honest. However, your issue did point to a problem with rulesets that I fixed in the latest dev release. Please try it when you get the chance and let me know if the problem persists.

bsnodgrass’s picture

Sorry for the delay in testing the new dev version out.. Drupalcon has me occupied!

this is from the Mar-05 dev version. Received the following errors when turning on the VBO module.

* warning: mysqli_real_escape_string() expects parameter 2 to be string, array given in /home/net2comm/domains/dev6/promis/includes/database.mysqli.inc on line 323.
* user warning: Duplicate entry 'views_bulk_operations_ruleset_action_rules_set_1' for key 1 query: INSERT INTO actions (aid, type, callback, parameters, description) VALUES ('views_bulk_operations_ruleset_action_rules_set_1', '', '', '', '') in /home/net2comm/domains/dev6/promis/includes/actions.inc on line 276.
* warning: preg_match() expects parameter 2 to be string, array given in /home/net2comm/domains/dev6/promis/includes/bootstrap.inc on line 771.

infojunkie’s picture

Title: Errors created when truning on Views Blk Operations Module » Duplicate entry 'views_bulk_operations_ruleset_action_XXX' for key 1

Thanks bsnodgrass, and enjoy Drupalcon! I'm still looking into this.

DanielJohnston’s picture

Subscribing. Installing Rules on top of VBO and various other modules introduces these errors for me too.

infojunkie’s picture

Can you please explain the sequence of events that lead to those errors? Do they appear when you turn on Rules while VBO is already enabled, or vice-versa? Or when you actually invoke a view?

CathyN’s picture

I am a new be and just want to get rid of the 100's of duplicate events that appeared all at once posted by an anomynous person that was not me. Where do I go to start to figure it out? I've done 'get started'

DanielJohnston’s picture

Appear when turning on Rules while VBO is enabled. Can't guarantee that VBO is the cause of this issue, but this is the only bug report in the whole of d.o that matches. Further related errors appear when trying to use various parts of Rules, e.g.

/admin/rules/rule_sets gives
warning: preg_match() expects parameter 2 to be string, array given in /srv/danieljohnston.co.uk/public/htdocs/includes/bootstrap.inc on line 771.

/admin/rules/rules/rules_2/add/action/2?destination=admin%2Frules%2Frules%2Frules_2 gives

    * warning: Illegal offset type in isset or empty in /srv/danieljohnston.co.uk/public/htdocs/sites/all/modules/rules/rules/modules/rules.rules.inc on line 294.
    * warning: preg_match() expects parameter 2 to be string, array given in /srv/danieljohnston.co.uk/public/htdocs/includes/bootstrap.inc on line 771.
    * warning: Illegal offset type in /srv/danieljohnston.co.uk/public/htdocs/sites/all/modules/rules/rules/rules.module on line 392.
    * warning: Illegal offset type in /srv/danieljohnston.co.uk/public/htdocs/sites/all/modules/rules/rules/rules.module on line 393.
    * warning: Illegal offset type in /srv/danieljohnston.co.uk/public/htdocs/sites/all/modules/rules/rules/rules.module on line 392.
    * warning: Illegal offset type in /srv/danieljohnston.co.uk/public/htdocs/sites/all/modules/rules/rules/rules.module on line 393.
    * warning: Illegal offset type in /srv/danieljohnston.co.uk/public/htdocs/sites/all/modules/rules/rules/rules.module on line 392.
    * warning: Illegal offset type in /srv/danieljohnston.co.uk/public/htdocs/sites/all/modules/rules/rules/rules.module on line 393.
    * warning: Illegal offset type in /srv/danieljohnston.co.uk/public/htdocs/sites/all/modules/rules/rules/rules.module on line 392.
    * warning: Illegal offset type in /srv/danieljohnston.co.uk/public/htdocs/sites/all/modules/rules/rules/rules.module on line 393.

For reference, I have the following modules installed on a D6 site latest version:
admin_menu better_formats filefield imagecache logintoboggan notifications role_delegation token views
advanced_help cck flatcomments imagefield messaging og rules transliteration views_bulk_operations
author_pane content_profile globalredirect lightbox2 mollom og_promote simplenews ubercart webform
backup_migrate date imageapi link node_import pathauto simplenews_register user_import

Hope that helps!

squarecandy’s picture

Hi all - having the same issue w/ VBO 6.x-1.5 - no errors with either rules or VBO modules turned on. But with both I get this:

* warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /var/www/berkshirefilm.com/html/new/includes/database.mysql.inc on line 321.
* user warning: Duplicate entry 'views_bulk_operations_ruleset_action' for key 1 query: INSERT INTO actions (aid, type, callback, parameters, description) VALUES ('views_bulk_operations_ruleset_action', '', '', '', '') in /var/www/berkshirefilm.com/html/new/includes/actions.inc on line 274.
* warning: preg_match() expects parameter 2 to be string, array given in /var/www/berkshirefilm.com/html/new/includes/bootstrap.inc on line 761.

I don't know much about what's under the hood yet, but I'm eager to learn and help with this issue if I can.

- P

infojunkie’s picture

Thanks for your reports. I haven't been able to reproduce this on my development installation so I'll try on a plain vanilla Drupal. Will keep you posted.

bsnodgrass’s picture

In my case I had rules already enabled and got the error when I turned on VBO

bsnodgrass’s picture

CathyN - you may have this posted in the wrong place depending on what those errors are. Somewhere in errors there should be clues for you, perhaps they are the same as the ones posted on this issue. I'm not sure what the state of your site is (testing dev or live) but if you are live you probably want to go to admin/site configuration/error reporting and turn off reporting to screen.

infojunkie’s picture

Still unable to repro this bug...

For those who don't care about calling rule sets from VBO, you can just rename rules.action.inc to rules.action.bug

To help me with debugging, can someone who has that problem please add this to rules.action.inc after line 14 and let me know if it makes a difference:

        'rules_ignore' => true,

Thanks in advance!

j0rd’s picture

adding "'rules_ignore' => true," removes the SQL error for me.

infojunkie’s picture

Thanks j0rd! I've committed that fix to the latest dev update. Other reporters, please confirm.

bsnodgrass’s picture

removed the error for me!

Thanks... Just in time as I think VBO will do great things !! Looking forward to using it.

DanielJohnston’s picture

OK, just updated to dev version. Going through the rule creation process, I reach the point of adding actions to a rule and get:

    * warning: preg_match() expects parameter 2 to be string, array given in /srv/danieljohnston.co.uk/public/htdocs/includes/bootstrap.inc on line 771.
    * warning: Illegal offset type in /srv/danieljohnston.co.uk/public/htdocs/sites/all/modules/rules/rules/rules.module on line 392.
    * warning: Illegal offset type in /srv/danieljohnston.co.uk/public/htdocs/sites/all/modules/rules/rules/rules.module on line 393.
    * warning: Illegal offset type in /srv/danieljohnston.co.uk/public/htdocs/sites/all/modules/rules/rules/rules.module on line 392.
    * warning: Illegal offset type in /srv/danieljohnston.co.uk/public/htdocs/sites/all/modules/rules/rules/rules.module on line 393.
    * warning: Illegal offset type in /srv/danieljohnston.co.uk/public/htdocs/sites/all/modules/rules/rules/rules.module on line 392.
    * warning: Illegal offset type in /srv/danieljohnston.co.uk/public/htdocs/sites/all/modules/rules/rules/rules.module on line 393.
    * warning: Illegal offset type in /srv/danieljohnston.co.uk/public/htdocs/sites/all/modules/rules/rules/rules.module on line 392.
    * warning: Illegal offset type in /srv/danieljohnston.co.uk/public/htdocs/sites/all/modules/rules/rules/rules.module on line 393.

Is this likely to be the same issue, or have I found something entirely different?

infojunkie’s picture

@DanielJohnston: you don't get these when VBO is not active?

DanielJohnston’s picture

Oops. I still get these with inactive VBO. Looks like I'm hitting something entirely different. Immediate thought is that it might be left-over actions from deinstall of Organic Groups. Ignore my previous reports.

infojunkie’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

simonmd’s picture

Version: 6.x-1.5 » 6.x-1.x-dev
Status: Closed (fixed) » Active

I'm still getting the original "Duplicate entry 'views_bulk_operations_ruleset_action_rules_set_1' for key 1" issue using the latest 6.x-1.x-dev ...

I am also getting the "preg_match() expects parameter 2 to be string, array given in..."

Are these two warnings somehow related? I see that DanielJohnston had this issue as well, but it didn't seem to be VBO.

Any insights?

infojunkie’s picture

@simonmd: can you confirm that the fix in comment #17 is there in the module code?

If it is, please make sure that you don't have multiple instances of VBO in your modules folder. I've seen that happen many times and it's a major source of confusion.

simonmd’s picture

Indeed it is, line 15 of rules.action.inc reads:

'rules_ignore' => true,

There is also just one instance of views_bulk_operations in my modules folder.

Deactivating the 'Rules' module (not surprisingly) gets rid of these errors, but I really need it.. :(

infojunkie’s picture

As a workaround, you can rename the file rules.action.inc in VBO to rules.action.bug. In the meantime, I'll look at this again to see what else can be wrong.

simonmd’s picture

This would disable triggering of rules with VBO, I assume?

infojunkie’s picture

More specifically, this would disable the ability to invoke rulesets via the VBO interface.

simonmd’s picture

Rule Sets, but not individual triggered rules? That could work for me..

fago’s picture

I had a short look at the rules.action.inc file - I think the problem is that your function name accidentally implements hook_rules_action_info(), but doesn't return stuff in the format rules is expecting. So renaming the function should fix this problem.

Anyway, I'd suggest keeping rules ignore activated - as rules has (rules) actions to invoke a rule set on its own, so rules users won't need another one ;)

infojunkie’s picture

Thanks fago for your suggestion! I renamed the file and the function, so please everyone try out the latest dev release (12 hours from now).

infojunkie’s picture

Status: Active » Fixed

Fixed unless I hear back from the original posters.

Status: Fixed » Closed (fixed)

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