Closed (duplicate)
Project:
Registration codes
Version:
7.x-1.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Jul 2011 at 16:43 UTC
Updated:
7 Jan 2014 at 15:16 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mtndan commentedSpecifically, the page to add an organic group regcode rule is broken - it doesn't show the list of Organic Groups because it appears to be calling an old D6 function.
Comment #2
juliakoelsch commentedI've attached a patch to regcode_og.module that should fix this. It's the first patch I've ever created, so let me know if the format isn't correct.
Comment #3
mtndan commentedThanks so much. Will give it a try.
Comment #4
matt bSubscribe
Comment #5
matt bI applied the patch and it works, I can list the groups and assign them registration code tags. So the functionality is there for creating new rules, but not (atleast not visible to the user) for managing existing rules.
However, when I try to register I now get the error message:
Recoverable fatal error: Argument 2 passed to db_query() must be an array, string given, called in /home/www/.../sites/all/modules/regcode/regcode_og/regcode_og.module on line 170 and defined in db_query() (line 2282 of /home/www/.../public_html/includes/database/database.inc).I will investigate further, but wanted to record my findings here!
Comment #6
matt bOk, changing line 170 from
$res = db_query($query . ' WHERE term_data.tid IN (%s)', $tid_string);to
$res = db_query($query . ' WHERE term_data.tid IN (' . $tid_string . ')');fixes the problem I found above, however now I get the message:
Fatal error: Call to undefined function og_save_subscription() in /home/www/.../public_html/sites/all/modules/regcode/regcode_og/regcode_og.module on line 208I'm guessing this is a call to a v6 function that is no longer in v7. If I can find the v7 equivalent I think it'll work.
Comment #7
matt bReplacing
og_save_subscription($rule['ogid'], $account->uid, array('is_active' => 1));on line 208 with
og_group($rule['ogid'], array('entity' => $account));fixes the problem and now users are automatically subscribed to the groups as expected. I'll try and produce a patch. There is still the issue that you can only create rules, not delete them.
Comment #8
matt bPatch attached (includes the changes in #2 from Spry_Julia)
Comment #9
IronWorker commentedApplied the patch and now I see the groups being listed in the Organic Groups tab.
When I do the "Create Rule" it says it did it but I don't see anywhere there is a rule created. Nothing in Rules, nothing on this screen. Should the rules associated with particular regcodes be showing on this screen (like the roles tab) or are should these be showing in the rules workflow section?
If it is supposed to be this screen, I don't see any header either like there is in the Roles tab.
Comment #10
znerol commentedRewrite regcode_og in the spirit of the drupal 7 port of regcode_dynamic. Use machine_name and store rules in a variable instead of a database table. This will aid with the exportability of the configuration. Implement the user interface with some drupal 7 sugar, especially the self updating machine name widget and local actions.
Apply this patch on top of #8.
Comment #11
matt bznerol, your patch did not apply cleanly on mine (#8), but does apply cleanly to the original 7.x code, include the changes and some extra magic - works perfectly now! Thanks. I think this can be committed.
One concern I have is the use of the word 'rule' as this could easily be confused with the rules module, which we are not dependant on. Perhaps the word 'policy' would be better?
Comment #12
znerol commentedThanks for testing.
Regarding the naming: In my understanding a policy is made of rules ("policy rule"), i.e. it is something broader and therefore I don't think that this term will make things better. However I cannot think of a better term at this moment...
Regarding the rules-module. Probably it would make sense to expose some events which may trigger an action, but that should go into another ticket...
Comment #13
vertuli commentedPatch #10 does not apply on Patch #8, but does apply on a fresh install.
The group assignments weren't working correctly, but after doing a fresh Drupal re-install they now work. However, there is still an error which seems mostly cosmetic.
FYI, I have also installed the two new patches for the issues with regcode_roles.module
I've created two groups (same content type). I go to admin/config/people/regcode/og. I can create the new rule with no issue.
However, once the new rule is created and shown in the list of rules, I receive this error:
Notice: Undefined offset: 0 in og_label() (line 2213 of /.../sites/all/modules/og/og.module).
Strangely, I receive this error N times, where N is the number of OGs in the list that I did not check when creating the rule. Therefor, it's possible for me to avoid this error by creating a rule where every OG is assigned (obviously not my intent, though).
Also, in the Groups column in the rule list, there will be N commas, again where N is the number of unchecked OGs.
It seems, however, that the roles and groups are assigned properly. They did not earlier, but upon a fresh install they did.
Comment #14
znerol commentedPatch which fixes the problems pointed out in #13. Apply it on top of #10. After applying the patch you have to edit and resave every rule before the warnings will go away on the og rule page.
Comment #15
aidanlis commentedI've applied the patches in #10 and #14, as once I'd applied the one in #8 neither would apply, nor would it apply after, so ignoring that one. I've also given znerol maintainer status so he can apply patches freely!
Comment #17
daniorama commentedAt least in the 7.x-1.0 version, the "add rule" link in reg OG is not working, it shows me an empty page with an HTTP 500 (Internal Server Error) The rest of the submodules are working nicely.
I'm using D7.12 with the latest stable version of OG, the 7.x-2.0-alpha2 version.
Anyone experiencing the same problems?
Comment #18
BuFr commentedYes, same problem here
Comment #19
znerol commentedSorry, I cannot reproduce this. With OG 7.x-1.4 / regcode_og 7.x-1.0 everything works fine. I close this issue, please post a new one if your problem persists.
Comment #20
BuFr commentedI dont agree with the closure here, I still get the 500/wsod like Daniorama.
Comment #21
znerol commented@BuFr: Ok, then please provide me a complete list of modules including their versions you have activated on your site so I can try to reproduce the behaviour. Additionally a stack trace would also be helpful.
Comment #22
BuFr commentedVersions:
Drupal 7.12
OG 7.x-2.0-alpha2+56-dev
Registration 7.x-1.x-dev
And tons of other modules.
The error i'm getting when i click on "add rule":
Fatal error: Call to undefined function og_label() in ../sites/all/modules/regcode/regcode_og/regcode_og.module on line 164 (this is new, before i only got a white screen)
We are going to upgrade (D7.14 and OG) tonight, so that might fix things.
We will do some more debugging and hopefully fix it. If not, i'ill open a new issue?
Comment #23
znerol commentedThe development branch of OG (7.x-2.x) is currently a moving target. I was not able to find the version of OG you indicated and the current git head seems to be broken in some way such that neither groups nor posts can be created (when using og_example).
Regcode is compatible with OG versions 7.x-1.x. Either use that or wait until OG 2.x is becoming at least beta. Until then I will not attempt to port regcode_og.
Comment #24
BuFr commentedYour right, thanks for taking a look. On a clean install with OG 7.x-1.4 it works fine.
Comment #25
spidersilk commentedOG 2 has been out for a while now, as a full release - the current version is 7.x-2.2, and that's what is listed as the recommended version on the OG project page. So it's probably high time to get OG integration working with that. I see that some patches have been submitted in #1945688: OG 2.x Support & Allows OG rules to use specific code instead of just tags - are these likely to be committed any time soon?
I have applied the second patch in that post, and that got rid of the fatal error I was getting when trying to create OG rules (the same one as in #22 above), so as far as I can see it works well. But this issue really shouldn't have been marked "fixed" when the fix has not been committed yet.
Comment #26
aidanlis commentedDupe of #1945688: OG 2.x Support & Allows OG rules to use specific code instead of just tags