Closed (fixed)
Project:
Simplenews
Version:
7.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
6 Jul 2005 at 02:59 UTC
Updated:
25 Sep 2005 at 17:49 UTC
I just installed the module and, it seems to me that on every pag load it created another vocabulary for itself.
I got up to about 80 before I noticed it :P.
I had a quick look at the code, found the function that was creating them, then commented it out (see code below). This is NOT the best solution, but you may want to start there.
Code That I commented out:
function simplenews_get_vid() {
$vid = variable_get('simplenews_vid', '');
// Check to see if a vocabulary exists, else create one
$vid = db_result(db_query('SELECT vid FROM {vocabulary} WHERE vid = %d', $vid));
if (!$vid) {
//taxonomy_save_vocabulary() returns $status, and not $edit[] in Drupal 4.6+
$vocabulary = module_invoke('taxonomy', 'save_vocabulary', array('name' => t('Newsletter type'), 'multiple' => '0', 'required' => '0',
'hierarchy' => '0', 'relations' => '0', 'module' => 'simplenews', 'nodes' => array('simplenews')));
$vid = $vocabulary['vid'];
variable_set('simplenews_vid', $vid);
}
return $vid;
}
I don't really have the time to find th eproblem a post a patch, but I hope I have helped by making you aware of the problem.
Comments
Comment #1
DriesK commentedYou are probably not running Drupal 4.6.x but HEAD? In that case your problem is related to this bug:
http://drupal.org/node/19621. I should have mentioned in the readme file that simplenews doesn't work with Drupal HEAD for the moment for that reason.
It is because taxonomy_save_term() does not return vid anymore. The problem can be solved if Dries applies the _p_19621_taxosaveobjs.patch patch.
So for the moment, Simplenews can only be installed on Drupal 4.6.x.
Comment #2
DriesK commentedI ment taxonomy_save_vocabulary() of course, not taxonomy_save_term()...
Comment #3
nathanwastaken commentedThanks for that.
I actually did not read the 'read me' file, so even if you had satated it, I would still have done it.
Not a huge problem then. I will just apply the patch on my local version and see how I go from there.
Comment #4
DriesK commentedIf you apply the patch, you also have to change this section in simplenews.module from
into
Comment #5
nathanwastaken commentedwill do.... thanks for that.
Comment #6
dries commentedCommitted patch #19621 to CVS HEAD (core).
Comment #7
nathanwastaken commentedGREAT...
Thanks Dries... Makes things easier.
Comment #8
DriesK commentedCommitted simplenews.module fix to CVS HEAD.
Comment #9
(not verified) commentedComment #10
(not verified) commentedComment #11
Tobias Maier commentedComment #12
(not verified) commentedComment #13
DriesK commentedClosed because the automatic close feature in project module is broken, and the issue list is becoming cluttered.