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.
When a user, with appropriate rights, tries to edit a term they get access denied returned after clicking the edit link. This is caused by what I think is a typo on line 517 in og_vocab.module. You are passing in $term->tid where you should be passing in $term->vid. I will submit a patch here once I have generated one.
Comment | File | Size | Author |
---|---|---|---|
#10 | 1472124-access-check-10.patch | 1.27 KB | amitaibu |
#8 | og_vocab-1472124-8.patch | 721 bytes | Ki |
#2 | og_vocab-1472124-2.patch | 550 bytes | pgillis |
Comments
Comment #1
pgillis CreditAttribution: pgillis commentedUpdated title to something more appropriate.
Comment #2
pgillis CreditAttribution: pgillis commentedAttached is patch.
Comment #3
christefano CreditAttribution: christefano commentedTagging. This may be what we need to make OG Vocab work again on groups.drupal.org.
Comment #4
FatherShawnUpgraded a site to 1.2 and made the indicated change on line 517. Created a vocabulary (tags) in a group, vocab displays on node-id/og_vocab. Edit an existing or create new posting - vocab missing from edit form, also missing on reload of node-id/vocab. Vocab exists at /admin/content/taxonomy/list.
Rolled back patch and this behavior disappears - module functions normally.
Comment #5
bobmarchman CreditAttribution: bobmarchman commented#2 worked like a charm for me. This fix needs to go in regardless because that is the appropriate argument for taxonomy_vocabulary_load(). If the patch causes a regression, then that should be fixed elsewhere, but I see no reason on the surface why this patch shouldn't go in.
Comment #6
christefano CreditAttribution: christefano commentedFatherShawn, did you mean to change the status to "needs work"? From what you and bobmarchman are saying in your comments, the patch works as intended and should be RTBC'd. (I'm not marking it RTBC myself since I haven't tested this yet.)
Comment #7
netsensei CreditAttribution: netsensei commentedJust spent the better part of the last 2 hours hunting the same bug.
$vocab = taxonomy_vocabulary_load($term->tid);
shoud be
$vocab = taxonomy_vocabulary_load($term->vid);
Refering to the Drupal API: http://api.drupal.org/api/drupal/modules%21taxonomy%21taxonomy.module/fu... where it the first function argument should be the vocabulary ID. og_vocab passes the Term ID which causes either one of two things to happen: the passed term accidentally matches an existing vocabulary related to a totally different group then the active one, or the function always returns FALSE if there the argument doesn't match any existing vocabulary id.
I'd call this a critical one since it seriously breaks access behaviour.
Comment #8
Ki CreditAttribution: Ki commentedI think there are actually two places that need fix.
Edit: Code above is revised and attachment can be ignored. I could not drop it in edit mode.
Comment #9
capellicI solved this problem on my own and then I found this case and came to the same conclusion... tid should be vid. I applied the patch in #8 for good measure. It all works. Can we get this into Dev?
Comment #10
amitaibuDoes this work for you?
Comment #11
amitaibuTestbot, wake up!
Comment #12
evans.bernier CreditAttribution: evans.bernier commentedComment #13
amitaibuAny testers?
Comment #14
pgillis CreditAttribution: pgillis commentedTested locally and works for me.
Comment #15
amitaibuCommitted.
Comment #17
christefano CreditAttribution: christefano commentedThis was committed but there hasn't been a 6.x-1.3 release yet.
Comment #18
christefano CreditAttribution: christefano commentedThere is now a 6.x-1.3 release for OG Vocab:
https://www.drupal.org/node/2311423