Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
WIP
Comment | File | Size | Author |
---|---|---|---|
#9 | rules-port-1421422.patch | 8.97 KB | g089h515r806 |
#6 | rules-port-1502956.patch | 8.97 KB | g089h515r806 |
Comments
Comment #1
amitaibuUntested.
git checkout -b 1421422
Comment #5
zualas CreditAttribution: zualas commentedWondering if Rules integration is in the dev release. Right now looks like the rules for OG don't work, for example "OG group members" returns empty values.
Comment #6
g089h515r806 CreditAttribution: g089h515r806 commentedI have upload a patch at http://drupal.org/node/1502956 ,
Which fixed all the issues of rules integration that i could find.
I upload the latest patch at here.
Comment #7
amitaibuYou should use entityFieldQuery here.
Start with capital, and finish with dot.
Remove space.
Comment #8
g089h515r806 CreditAttribution: g089h515r806 commentedUsing db_select is much easier than entityFieldQuery at here.
If we use entityFieldQuery,
1,then we get the membership ids first,
2,we need write a foreach function,
3,then we need load all the membership objects through ids,
4,then get the etid.
It is much complex than using db_select.
Instead of using db_select,which could get all current members in one step. we write less code, and the speed is quick than using entityFieldQuery.
There are a lot place in drupal core, which could use entityFieldQuery also coudl use db_select. at most case, they use
db_select instead of entityFieldQuery. for example
At here using entityFieldQuery also works, but if we use db_select, it is much short, concise, quick.
So I think we do not need to use entityFieldQuery instead of db_select at here.
Comment #9
g089h515r806 CreditAttribution: g089h515r806 commentedhere is the latest patch, fixed "Start with capital, and finish with dot.", and "Remove space.".
Comment #10
mradcliffeI tested the patch last week, and it does work fairly well for the standard use cases. The rules are now restricted to group nodes, but could possibly be used for other group entities like user or anything that has a uid column.
I played around with the rules integration some more and was able to come up with more complex things.
Is there a base set of rules functionality we need to test manually for this task?
Changing status to run latest patch through automated tests (hopefully).
Comment #11
g089h515r806 CreditAttribution: g089h515r806 commentedI have spend my three days vocation to port it to 2.x. and did not earn 1 commit to OG.
Comment #12
amitaibu> I have spend my three days vocation to port it to 2.x. and did not earn 1 commit to OG.
I'm waiting (hoping) for community review, as I don't user Rules myself, I prefer someone more familiar to go over it.
Comment #13
mradcliffeI think the patch is a good start, but we will only find out the more edge cases in further issues.
Comment #14
amitaibuThanks guys, committed -- and of course credited g089h515r806 :)
Comment #15
g089h515r806 CreditAttribution: g089h515r806 commentedThanks Amitaibu, i earn another commit to OG. I have 2 commits now.
Comment #16
amitaibug089h515r806, keep the patches coming, and you'll get more commits! :)
Comment #18
modctek CreditAttribution: modctek commentedI saw that this was committed over a month ago, but still not a part of alpha-3? I see it in the patch notes, but I don't see any triggers for OG. Have I configured something incorrectly?Never mind, I was confusing D7's triggers with Rules but then I finally sobered up. :)