An improvement of OG Vocab allow to share a vocabulary between several groups
http://drupal.org/node/678934

This behavior prevent terms from share vocabularies to be propagated to FF attachments.
The following code fixes the issue:

in file.inc, replace at line 1546

     while ($row = db_fetch_object($result)) {
        if (in_array($row->nid, array_keys($user->og_groups)))
          $og_vocabs[] = $row->vid;
        else
          $og_vocabs_hidden[] = $row->vid;
      }

by

    while ($row = db_fetch_object($result)) {
        if (in_array($row->nid, array_keys($user->og_groups)))
          $og_vocabs[] = $row->vid;
        else
 // JV changed for modified OG Vocab - common vocabulary       
          if (!in_array($row->vid, $og_vocabs))
            $og_vocabs_hidden[] = $row->vid;
          else
            unset($og_vocabs_hidden[array_search($row->vid, $og_vocabs_hidden)]);
      }

I am not a developer, cannot write a patch, even less maintain the sources...

Comments

jvieille’s picture

Could it be possible to commit this small change ?
I hate maintaining different modules than officials....

Bellow a more conventional way of showing the diff

function _file_propagate_terms($node, $file_node, $settings = array()) {
  if (!module_exists('taxonomy'))
    return FALSE;

  if (!empty($node->taxonomy)) {
    global $user;

    // Retrieve the list of vocabulary IDs from which we'll propagate
    // taxonomy terms associated with the containing parent node to any
    // contained file attachment nodes:
    $vocabularies = taxonomy_get_vocabularies('file');
    $og_vocabs = $og_vocabs_hidden = array();
    if (module_exists('og_vocab')) {
      $result = db_query('SELECT nid, vid FROM {og_vocab}');
      while ($row = db_fetch_object($result)) {
        if (in_array($row->nid, array_keys($user->og_groups)))
          $og_vocabs[] = $row->vid;
        else
+         if (!in_array($row->vid, $og_vocabs))
               $og_vocabs_hidden[] = $row->vid;
+          else
+             unset($og_vocabs_hidden[array_search($row->vid, $og_vocabs_hidden)]);  
      }
    }
...
johanneshahn’s picture

Status: Active » Needs work

hi,
how to setup groups to test this?

jvieille’s picture

That is quite simple. Install Organic Groups latest version
http://drupal.org/project/og
and OG voca.bulary
http://drupal.org/project/og_vocab

My OG vocab is slightly modified, based on a previous version - the change should not affect the published version, but makes mine propagating the terms

By the way, FF does a very good job at supporting OG, one major reason I chosen FF for file management. In this sense, you will definitely benefit investing some time in mastering OG, which is rather easy to setup and master. It makes you able to create apparently independent sites in a consistent environment with a great flexibility for content visibility (you can forget the complex taxonomy access control or other access modules)

jvieille’s picture

Any plan to integrate this in FF.
It is part of the changes I made that prevent me to upgrade to latest FF releases.

This does not break anything, just make FF more tolerant on different ways of dealing with taxonomies.
Thanks

jvieille’s picture

Status: Needs work » Reviewed & tested by the community

No problem after 1,5 year
Could this be ported?
This will clean up the queue by one item...

Thanks

gobinathm’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Closed (outdated)

Closing the issue. It was inactive for a long time & it's related to a Drupal Version which is not supported anymore