If I create a new rule, set the action to "show a message on the site," and then click the "Switch to data selector" button, I get an error:

Notice: Undefined index: custom translation language in selectionForm() (line 90 of /.../sites/all/modules/rules/ui/ui.data.inc

The error happens right here:

    if (!empty($info['translatable'])) {
      if ($info['custom translation language']) {

It checks whether $info['translatable'] is empty, but then acts on the value of $info['custom translation language'] without knowing whether or not it exists.

This has been reported elsewhere (See #1533398: token replacement not working?) but the fix on that was related to something else, probably whatever upstream caller is setting the former value without setting the latter. I assume this is a mistake in how this function is called, probably by another module, but why not do a second check before using that value? This simple change removed the error and lets me create the rule, without having to figure out why the function is being called with apparently mis-set parameters:

    if (!empty($info['translatable'])) {
      if (!empty($info['custom translation language'])) {

This looks like it will work fine; the following "else" is accurate in that the field will not be translated to the configured language if there is none set.

Files: 
CommentFileSizeAuthor
#5 rules-1719510.patch669 bytesKen Ficara
FAILED: [[SimpleTest]]: [MySQL] 281 pass(es), 2 fail(s), and 1 exception(s).
[ View ]
#1 rules-1719510.patch765 bytesKen Ficara
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch rules-1719510_0.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Comments

StatusFileSize
new765 bytes
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch rules-1719510_0.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Status:Active» Needs review

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

Clarifying -- this happens in both 2.2 and 2.1, albeit with a different line number in 2.1.

Status:Needs review» Needs work

The last submitted patch, rules-1719510.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new669 bytes
FAILED: [[SimpleTest]]: [MySQL] 281 pass(es), 2 fail(s), and 1 exception(s).
[ View ]

Sorry testbot -- ran the diff at drupal root instead of in the rules module. Fixed.

Status:Needs review» Needs work

The last submitted patch, rules-1719510.patch, failed testing.

Version:7.x-2.2» 7.x-2.x-dev
Assigned:Unassigned» klausi
Status:Needs work» Reviewed & tested by the community

Works for me.

Status:Reviewed & tested by the community» Fixed

Thanks, committed a slightly modified version of this patch.

Status:Fixed» Closed (fixed)

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