Comments

giorgio79’s picture

Version: 6.x-1.x-dev » 6.x-1.3
Component: Rules Core » Rules Engine
Status: Active » Needs review
StatusFileSize
new993 bytes
new878 bytes

Here is a patch. Please check :)

6.1.3 was older than the dev release so I rolled it against 6.1.3

Here is an example for user load by email http://api.drupal.org/api/function/user_load

Status: Needs review » Needs work

The last submitted patch, user.rules_forms.inc_.patch, failed testing.

giorgio79’s picture

The error says: "Ensure the patch applies to the lastest checkotu of the code-base."

Well, too bad. As per the front page 6.1.3 is the latest... All the best test bot.

6.x-1.3 Download (207.11 KB) 2010-Sep-02 Notes
6.x-1.x-dev Download (207.12 KB) 2010-Aug-17 Notes

giorgio79’s picture

Hmm, just checked out the latest from github as per the front page.

I see these user files have massively changed since the last version...

klausi’s picture

Version: 6.x-1.3 » 6.x-1.x-dev

you need to create the patch form the rules root directory http://drupal.org/patch/create

giorgio79’s picture

Status: Needs work » Needs review
StatusFileSize
new1021 bytes
new906 bytes

Thanks, lets try again.

klausi’s picture

Status: Needs review » Needs work

And you need to provide the changes in one patch, please.

giorgio79’s picture

StatusFileSize
new1.86 KB

Thanks, lets see.

giorgio79’s picture

Status: Needs work » Needs review
StatusFileSize
new1.86 KB

hoops, wrong direction, lets try this.

Status: Needs review » Needs work

The last submitted patch, user.rules_.inc_.patch, failed testing.

giorgio79’s picture

Status: Needs work » Needs review
StatusFileSize
new1.82 KB

eh :D

klausi’s picture

Status: Needs review » Needs work
+++ rules/modules/user.rules.inc	Mon Jan 19 23:26:36 1970
@@ -162,7 +162,7 @@
+      'eval input' => array('userid', 'username','mail'),

missing white space before 'mail'

Powered by Dreditor.

giorgio79’s picture

StatusFileSize
new1.82 KB

Thanks, fixed.

giorgio79’s picture

Status: Needs work » Needs review
fago’s picture

Status: Needs review » Needs work

any testers? :)

@code:
"User mail", "mail", "email" - please be consistent with whatever label you use. Best do it the same way as core.

fago’s picture

oh
>+ $userarray = array('name' => $settings['username'], 'uid' => $settings['userid'], 'mail' => $settings['mail']);

This will generate a notice for old $settings without 'mail'.

twistedindustries’s picture

I just used the patch in #13 and it worked fine for what I needed it for. Thanks!

Encarte’s picture

subscribing

giorgio79’s picture

Status: Needs review » Needs work

Hey Fago and klausi,

I implemented a simple if else check to see if $settings has mail.
If that is not sufficient, could you give some tips on how could the patch solve the error notice you mention about old $settings?

I also made sure all instances have "mail" as in core. Attaching revised patch

giorgio79’s picture

StatusFileSize
new1019 bytes
new1.98 KB
giorgio79’s picture

Status: Needs work » Needs review

The last submitted patch, user.rules_forms.inc_.patch, failed testing.

giorgio79’s picture

Status: Needs work » Needs review
StatusFileSize
new1.07 KB
new1004 bytes

Don't you love patching?

Status: Needs review » Needs work

The last submitted patch, user.rules_forms.inc_.patch, failed testing.

giorgio79’s picture

Status: Needs work » Needs review
StatusFileSize
new1.01 KB
new1.09 KB

Maybe from module root :D

klausi’s picture

Status: Needs review » Needs work
+++ rules/modules/user.rules.inc	2011-04-16 08:56:16.000000000 -0400
@@ -215,7 +215,10 @@ function rules_action_user_removerole($u
+  if ($settings['mail'])
+    $userarray = array('name' => $settings['username'], 'uid' => $settings['userid']);
+  else
+    $userarray = array('name' => $settings['username'], 'uid' => $settings['userid'], 'mail' => $settings['mail']);

please use braces as required by the Drupal coding standards. Furthermore you have to use isset(), because the 'mail' array key may not be set and could generate a notice. And I think you swapped the if/else branches by mistake.

And please create one patch file that contains all changes.

And please create patches in the new -p1 format, see http://drupal.org/patch/create ;-)

Powered by Dreditor.

giorgio79’s picture

Status: Needs work » Needs review
StatusFileSize
new2.23 KB

Much appreciated klausi! Thanks for your help. I believe this is ready now.

(Git is awesome, just got my head around it.Patching with it was a breeze, even on Windows :D)

giorgio79’s picture

StatusFileSize
new2.23 KB

Discovered a small typo ( a semi colon missing)

philltran’s picture

giorgio79’s picture

Status: Needs review » Closed (won't fix)

I notice this is way way better in D7, with the entity property selector. Wow, fantastic. I wont pursue this further.

klausi’s picture

Status: Closed (won't fix) » Needs review

but maybe others want to pick this up.

tr’s picture

Component: Rules Engine » Rules Core
Issue summary: View changes
Status: Needs review » Closed (won't fix)

This feature is available in Rules in D7 and D8, and won't be implemented in the now-obsolete D6 version of Rules.