Unnecessary db errors
yettyn - October 8, 2008 - 23:08
| Project: | Taxonews |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Ok this might be minor as it just happens when there are no terms in db, but still it's an easy fix and I see no reason to not do it.
After installing taxonews and going to Blocks, in case there are no terms (typically when starting to build a site) a bunch of db related errors are triggered, making the main warning message about needed configuration "disapear" in the flora of messages. This little fix in taxonews.module approx line 420 cure it:
/**
* Query for terms in the vocabularies selected in settings
*
* @return array [tid, name]
*/
static function getTerms()
{
static $arTerms = array();
if (empty($arTerms))
{
$arVids = variable_get(self::VAR_VOCABULARY, array());
+ if (empty($arVids))
+ {
+ return false;
+ }
$sq = 'SELECT td.tid, td.name, 'Possibly it can be done more effectively, but it works.

#1
Thanks for your report. I fixed it a bit differently.
#2
Fixed in today's version 1.10.8.9.
#3
Ok guess that works as well ;-)
Another thing, instead of creating a DRUPAL-7 branch you should simply let HEAD keep the D7 development, not even core has a D7 branch (except for HEAD) as nothing been released yet.
#4
I don't like coding in HEAD for contrib, because one never knows what version or core it is good for, as this will evolve over time. Let me summarize a recent discussion about this on the dev list
By contrast, had Alice kept foo branched per-core-branch, the launch of D7 core wouldn't have had any impact. For more details or discussion about this, I suggest you read http://drupal.org/node/17570, which describes the strategy I apply under the heading "Only sync changes to HEAD when you're going to start a new branch".
#5
Well I couldn't disagree more as it's no good to build a strategy on an exception, but I will read the node an possibly dive into the discussion - so no point of discussing this further here ;-)
#6
Automatically closed -- issue fixed for two weeks with no activity.