Just got my drupal set up, have a few modules enabled, main ones to note is profile , content profile.. I went to the profile content type, added 1 field, made sure on the edit box to enabled this content type as profile..

next as admin I added new user from the admin .. when saving that user this spit out at the top..

User warning: Unknown column 'na.type' in 'where clause' query: SELECT n.nid, n.type, n.language, n.uid, n.status, n.created, n.changed, n.comment, n.promote, n.moderate, n.sticky, n.tnid, n.translate, r.vid, r.uid AS revision_uid, r.title, r.body, r.teaser, r.log, r.timestamp AS revision_timestamp, r.format, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid WHERE na.type = 'profile' AND na.uid = '3' in _db_query() (line 147 of /var/www/includes/database.mysqli.inc).

Granted its just a warning but still seems like something is messed up..

changing the last two things in the sql and testing it in phpmyadmin worked..

not sure why its na.type = or na.uid , if you do n.type and n.uid the query works..

any thoughts on this?

Just to confirm disabling the content profile module , and adding new users this error goes away.

Comments

vishun’s picture

Part of the issue may be related to content profile not successfully determining the users content profile when they do or do not have one. I may have partially isolated the issue and it may or may not be related to some advanced caching (pressflow, memcache, varnish, apc).

It appears that the issue may be happening in content_profile_load()

<?php
function content_profile_load($type, $uid, $lang = '', $reset = NULL) {
  static $cache = array();

  if (!isset($cache[$type][$uid][$lang]) || $reset) {
    $cache[$type][$uid][$lang] = FALSE;
    $params = array('type' => $type, 'uid' => $uid);
    if ($node = node_load($lang ? $params + array('language' => $lang) : $params, NULL, $reset)) {
      $cache[$type][$uid][$lang] = $node->nid;
    }
    return $node;
  }
  return !empty($cache[$type][$uid][$lang]) ? node_load($cache[$type][$uid][$lang]) : FALSE;
}
?>

When you "return node_load($cache[$type][$uid][$lang]);" after "static $cache = array();" it quiets the MySQL warning, but content profile still believes that user does not have a content profile. If I "return node_load(123);" it works fine and as expected.

Still need to do a bit of backtracking, but if anyone has any hints in the mean time, that would be great.