Hi.
Thanks for this great module. Its exactly what we need for the new version of drupalcenter.de :)
Unfortunately using the vocabulary id as key for the config on admin/config/taxonomy-tools/role-access makes it difficult (or even impossible) to use a clean export of the variable with features.
Guess you've exported the configuration with features using vid:2 and enable the feature on a site with some existing vocabularies. After the import the configuration would point to the wrong vocabulary.

The attached patch changes this to use the machine name of the vocabularies, so it doesn't matter anymore how many vocabularies you have.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

stBorchert’s picture

Updated patch (previous one wasn't complete).

martins.bertins’s picture

Assigned: Unassigned » martins.bertins

Thanks for the input. I'll take a look at this.

stBorchert’s picture

The last patch is still incomplete. I forgot some code in taxonomy_tools_rebuild_access_grants():

<?php
  if (module_exists('taxonomy_tools_role_access') && !$rebuild) {
    // Whether Taxonomy Role access module is enabled.
    $config = variable_get('taxonomy_tools_role_access_vocab_config', array());
    // Only if the vocabulary uses Taxonomy Role access.
    if (!empty($config) && (($vocabulary = taxonomy_vocabulary_load($term->vid)) !== FALSE) && in_array($vocabulary->machine_name, $config)) {
?>
SteffenR’s picture

Hi stborchert - i rerolled the patch against the latest DEV of the module and also included your missing piece of code :)

SteffenR

martins.bertins’s picture

Status: Needs review » Closed (fixed)

Commited
With small changes to initial patch + had to ensure upgrade path.