Hi,
I was having a problem that after saving information on admin/content/nodewords/meta-tags, the form shows empty values, but the data was actually saved on the database.
After some investigation, I found that the function nodewords_load_tags didn't return the correct array with the data.
Below is the version of this function after I made some changes to make it work, and seems to be working now.
function nodewords_load_tags($type = NODEWORDS_TYPE_DEFAULT, $id = 0) {
static $queries = array();
// If the metatags haven't been loaded before, load them.
if (!isset($queries[$type][$id])) {
$result = db_query("SELECT * FROM {nodewords} WHERE type = %d AND id = %d", $type, $id);
$tags = array();
$tags_info = nodewords_get_possible_tags();
while ($row = db_fetch_object($result)) {
if (isset($tags_info[$row->name])) {
$tags[$row->name] = unserialize($row->content);
}
}
// If no metatags are found for this term, try loading the vocabulary's.
if (empty($tags) && $type == NODEWORDS_TYPE_TERM) {
$tags = nodewords_load_tags(NODEWORDS_TYPE_VOCABULARY, db_result(db_query('SELECT vid FROM {term_data} WHERE tid = %d', $id)));
}
// Cache the metatags for later.
$queries[$type][$id] = $tags;
}
return $queries[$type][$id];
}
Comments
Comment #1
madhan mohan commentedHi again,
I've faced some other issue with this version, custom meta tags (set on the node) were not being printed on the page, I was getting always the default tags.
Again some changes on nodewords_load_tags did the trick:
This function is called by nodewords_preprocess_page() by using the code: nodewords_load_tags($options), so a checking on the $type variable seems to fixed the problem.
Comment #2
damienmckennaThanks for finding that, I can't believe that bug slipped past!
Instead of applying the change of your second code snippet I just changed nodewords_preprocess_page() to pass the individual values.
Comment #3
damienmckennaComment #4
damienmckennaTagging.
Comment #5
damienmckennaCommitted. Thanks.
Comment #6
cfox612 commentedI'm having this same issue, but I've never applied a patch. Where exactly do I place this code?
Comment #7
damienmckenna@cfox612: You can also just try out the 6.x-1.x-dev version, it includes the fix and many more.
Comment #8
cfox612 commentedI installed the dev version over the previous, and get a nice set of errors on the "other pages" tab:
Comment #9
damienmckennaGetting off-track here, but make sure you clear your site caches and run the database updates.
Comment #10
cfox612 commentedIt's always the little things, thanks much!
Comment #11
damienmckennaResetting the priority. Lets leave this discussion closed, please start a new issue for any further issues. Thanks everyone :)