Drupal 5.x support + Multiple vocabulary support

pvasener - June 12, 2007 - 13:58
Project:Taxonews
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

I found this module very interesting for my site but I needed Drupal 5.x and multiple vocabulary support. This was simple as hell to hack so here is the result (to be tested of course...)

AttachmentSize
taxonews-5.x-1.0.tar_.gz12.36 KB

#1

fgm - June 12, 2007 - 21:29
Status:needs review» needs work

Hi, thanks for your efforts.

This could go into the module, but you need to do some changes first:

  • apply changes to the shiny new version in the DRUPAL-5 branch: it has been completely overhauled, porting your changes will be easier for you (who know what you did), than for me
  • submit as a patch to taxonews.module only, not as a full directory

Beyond this, I'm afraid that allowing multiple vocabularies to be selected will create massive quantities of blocks: maybe an additional selection/filtering mechanism in the settings form would be in order, to avoid swamping the block list.

How about a tab on the settings form, to allow a first level of interactive block selection (AJAX ?). admin/block would then only be applied to the blocks allowed from this level.

#2

fgm - June 12, 2007 - 21:30
Version:4.7.x-1.x-dev» 5.x-1.x-dev

Applying branch change

#3

pvasener - June 13, 2007 - 10:23

Thanks for this 5.x initial release. Here is my patch to support multiple vocabularies. This patch also corrects a bug which prevents the saving of the vocabulary settings (extra quotes).
Concerning your worries about massive number of blocks, it indeed depends on the number of terms involved in the vocabularies not on the number of vocabularies itself. So, I don't think it is relevant. However, I think your suggestion for a tab in the settings form would be interesting to develop.

AttachmentSize
multi_vocab.patch 2.16 KB

#4

fgm - June 13, 2007 - 19:23

Thanks for spotting the typo in the settings, and for the patch.

I made some changes to it, and the modified version is attached here:

  • standard JOIN instead or the old Oracle-like joins using WHERE
  • formatting

But it still needs another change: currently, the Taxonews::getTerms() method invokes db_query in a loop, which is not recommended. It would probably be better to generate a single query for all vocabularies and loop on its results than to generate as many queries as there are vocabularies. Can you fix this ? After that we can benchmark the two approaches just to be sure and commit the patch.

A small patch to the .mo and .po files will be needed too, since some wording is changed by this patch.

AttachmentSize
taxonews.module.patch 3.1 KB

#5

fgm - August 12, 2007 - 12:22
Version:5.x-1.x-dev» 6.x-1.x-dev
Status:needs work» fixed

This has been included in the Drupal 6 branch committed today.

But would still welcome the performance improvement.

#6

Anonymous - August 26, 2007 - 12:33
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.