Hi

I tried module with drupal 6.3. I have created taxonomy but module have just one options - Create subdomains for users. Why? :(
Please help me.

Thanks.

CommentFileSizeAuthor
#7 subdomain.patch2.13 KBakor

Comments

akor’s picture

seems drupal have hierarchy taxonomy by default (http://drupal.org/node/196600)

      foreach ($vocabs as $vocab) {
        //if (!$vocab->hierarchy) {
          $vocab_options[$vocab->vid] = $vocab->name;
        //}
akor’s picture

other code to fix subdomain generation for taxonomy

        case SUBDOMAIN_VOCAB:
          $vocab = variable_get('subdomain_vocab', NULL);
          if (is_array($object->taxonomy)) {
            foreach ($object->taxonomy as $tid) {
              $term_name = db_result(db_query("SELECT name FROM {term_data} WHERE tid = %d AND vid = %d", $tid, $vocab));
              if ($term_name) {
                $values['subdomain'] = subdomain_build_token($term_name, $tid);
                break;
              }
            }
          }
          break;
akor’s picture

and one more fix

    case 'taxonomy':
      $vocab = variable_get('subdomain_vocab', NULL);
      if (variable_get('subdomain_type', SUBDOMAIN_USER) == SUBDOMAIN_VOCAB) {
        $term_name = db_result(db_query("SELECT name FROM {term_data} WHERE tid = %d AND vid = %d", $object->tid, $vocab));

        if ($term_name)
          $values['subdomain'] = subdomain_build_token($object->name, $object->tid);
      }
      break;
setvik’s picture

Thanks for the fixes. Any chance you can submit as a patch? That'll help me review and test it more quickly.

setvik’s picture

Status: Active » Postponed (maintainer needs more info)
akor’s picture

I'll try to figure out how to make it :)

akor’s picture

StatusFileSize
new2.13 KB

I hope, I did it in the right way :)

akor’s picture

Status: Postponed (maintainer needs more info) » Needs review
setvik’s picture

Hi Akor,

Thanks so much for taking the time to roll those into a patch. That helps a lot!

I have one more favor - sorry! I should have asked this earlier.

Regarding #1 above: it makes sense and works great. I've applied it to my working copy and will check it in soon.

Regarding #2 and #3: Could you explain the reasons for those changes? Do they fix bugs? If so, what are the steps to reproducing the problem(s) fixed by the changes in comments #2 and #3.

Thanks in advance :-),

Stein

akor’s picture

Hi,

Yes #2 and #3 fixed bugs. Problem was that drupal 6.3 have not array $object->taxonomy[$vocab] anymore. It have only $object->taxonomy like array with TIDs.

Thanks.

setvik’s picture

I simplified patch #3 and applied it.

I haven't been able to reproduce the bug you say is fixed by patch #2, but I went ahead and committed it.

If you have time, can you post steps to reproduce the bug fixed by patch #2.

I should be able to roll a new release candidate today.

Thanks again,

Stein

setvik’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.