Upgrade for Drupal 6?
R.Hendel - February 1, 2009 - 09:41
| Project: | OG promote |
| Version: | HEAD |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
Hi,
I would be interested using that module in Drupal 6.
By looking over the issue queue, it doesn't look very close supported on me.
Is there a plan to upgrade it for D6?
Has anybody otherwise an idea, how to get functionality by another way?
Thanks in advance,
Ralf

#1
Subscribing. User Roles for OG doesn't seem able to change generic user roles based on group membership, which is necessary on the site I'm building right now.
#2
Try this patch.
#3
Here's the error I get when trying to patch, in og_promote.info:
; $Id: og_promote.info,v 1.1.2.1 2007/06/18 23:06:55 dww Exp $
name = OG promote
description = "Promote users that join certain groups to a special role."
- dependencies = og
package = "Organic groups"
--- 1,7 ----
; $Id: og_promote.info,v 1.1.2.1 2007/06/18 23:06:55 dww Exp $
name = OG promote
description = "Promote users that join certain groups to a special role."
+ dependencies[] = og
package = "Organic groups"
+ core = 6.x
+ php = 4.x
#4
The patch was created based on the DRUPAL-5 development branch. It looks like it fails on the official tarball.
Here's a patch that works with the tarball.
you'll probably need -p1 if you run it within the og_promote/ directory. Or place it in sites/all/modules and run with -p0.
The prior patch works with cvs checkouts of the module.
#5
Thanks for that. However, I seem to still running into problems.
# patch -p0 < og_promote-release.patch
patching file og_promote/og_promote.info
patching file og_promote/og_promote.module
Reversed (or previously applied) patch detected! Assume -R? [n] y
Hunk #2 FAILED at 16.
1 out of 3 hunks FAILED -- saving rejects to file og_promote/og_promote.module.rej
And the .rej file says:
***************
*** 16,40 ****
/**
* Implementation of hook_menu().
*/
- function og_promote_menu($may_cache) {
$items = array();
- if ($may_cache) {
- $items[] = array(
- 'path' => 'admin/og/og_promote',
- 'title' => t('OG promote'),
- 'description' => t('Choose a role to which members of selected groups will be promoted.'),
- 'callback' => 'drupal_get_form',
- 'callback arguments' => array('og_promote_admin_settings'),
- 'access' => user_access('administer site configuration'),
'type' => MENU_NORMAL_ITEM,
);
- }
return $items;
}
/**
* Implementation of hook_og().
*/
function og_promote_og($op, $nid, $uid, $args = array()) {
if (($role_id = variable_get('og_promote_role', 0)) != 0 && in_array($nid, variable_get('og_promote_groups', array()))) {
switch ($op) {
--- 16,38 ----
/**
* Implementation of hook_menu().
*/
+ function og_promote_menu() {
$items = array();
+ $items['admin/og/og_promote'] = array(
+ 'title' => 'OG promote',
+ 'description' => 'Choose a role to which members of selected groups will be promoted.',
+ 'page callback' => 'drupal_get_form',
+ 'page arguments' => array('og_promote_admin_settings'),
+ 'access arguments' => array('administer site configuration'),
'type' => MENU_NORMAL_ITEM,
);
return $items;
}
/**
* Implementation of hook_og().
*/
+ //op, $gid, $uid, $args
function og_promote_og($op, $nid, $uid, $args = array()) {
if (($role_id = variable_get('og_promote_role', 0)) != 0 && in_array($nid, variable_get('og_promote_groups', array()))) {
switch ($op) {
I've tried this with and without reversing the 'previous patch' that it keeps talking about, without any luck. Any ideas gratefully received.
#6
It looks like it's trying to reverse it. Can you try with a clean copy?
#7
Er, it is a clean copy? I just tried deleting then dling both the module and patch from scratch, and it still claims to detect a previous patch!
# patch -p0 < og_promote-release.patch
patching file og_promote/og_promote.info
patching file og_promote/og_promote.module
Reversed (or previously applied) patch detected! Assume -R? [n] n
Apply anyway? [n] y
Hunk #1 FAILED at 4.
Hunk #2 FAILED at 16.
Hunk #3 FAILED at 86.
3 out of 3 hunks FAILED -- saving rejects to file og_promote/og_promote.module.rej
Is it possible the 5.x-1.1 tarball isn't clean for some reason? Thanks for your help in this!
#8
Not heard anything back, but a further update on this. I can't even find the most recent versions in CVS - they've all been deleted with the annotation 'Removed files from head to simplify maintenance under the new release system.' Is there something I should know about drupal.org CVS?
#9
OK, belay that. My bad. I've found the files in the Drupal-5 branch of CVS and downloaded them. However, exactly the same error happens when I then try the patch:
#patch -p0 < og_promote-release.patch
patching file og_promote/og_promote.info
Reversed (or previously applied) patch detected! Assume -R? [n] y
patching file og_promote/og_promote.module
Reversed (or previously applied) patch detected! Assume -R? [n] y
Hunk #2 FAILED at 16.
1 out of 3 hunks FAILED -- saving rejects to file og_promote/og_promote.module.rej
I'm going to try editing in the patch manually to create a 6.x version. Let me know if you have any other suggestions.
#10
OK, I've manually edited the patch from #2 into the 5.x-1.1 release files, and it appears to work on my Drupal 6.9 install. I've attached the manually patched files, although obviously they should go in an og_promote folder before you install.
#11
I've adopted og_promote and will be working on this to hopefully get a D6 release out real soon.
#12
D6 release committed and should appear shortly.
#13
Automatically closed -- issue fixed for 2 weeks with no activity.