Closed (fixed)
Project:
Drupal core
Version:
6.x-dev
Component:
block.module
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
28 Jun 2007 at 10:44 UTC
Updated:
15 Jul 2007 at 21:46 UTC
Jump to comment: Most recent file
Comments
Comment #1
moshe weitzman commentedi'm not so sure about this. i think it is a slippery slope. if we want general hook for modules to rewrite sql, we should add it to db_query() and be done with it. i'm curious to hear opinions from chx and others. also, i don't know how you plan to use this, and thus am unsure how it will interact with the user's block visibility settings.
Comment #2
wim leersSubscribing.
Comment #3
jose reyero commentedMoshe,
i'm not so sure about this. i think it is a slippery slope. if we want general hook for modules to rewrite sql, we should add it to db_query() and be done with it. i'm curious to hear opinions from chx and others. also, i don't know how you plan to use this, and thus am unsure how it will interact with the user's block visibility settings
About the rewrite sql hook, it's already there, and it's all we have for now, so... I think this kind of adds consistency to the whole thing as this blocks query is one of the few listing queries not using it...
The way I plan to use this is:
- table block_language(bid, language)
- use forms api to show a language field for custom blocks
- then add the query join with hook_db_rewrite_sql().
The problem with blocks for multilingual sites are not the ones produced by modules, but the custom boxes you can create, and currently we have no way to translate it, so if only we could add them a language field and then use this to select blocks per language....
However this doesn't enforce any particular solution on Drupal core, it just leaves the doors open for contributed modules.
Comment #4
merlinofchaos commentedI think this is the kind of thing db_rewrite_sql is meant for.
Comment #5
webchickI agree.
Patch still applies, but wasn't rolled from root. Also, missed adding this change to the documentation of db_rewrite_sql. I also took the opportunity to wrap that line to 80 chars.
Marking RTBC, per merlin's comment.
Comment #6
gábor hojtsyThanks, committed!
Comment #7
(not verified) commented