drupal7: node作者被删后,对node重设uid
程序员文章站
2022-04-14 08:04:28
...
$nids = db_query('SELECT nid FROM node WHERE NOT EXISTS(SELECT NULL FROM users WHERE users.uid = node.uid)')->fetchCol(); foreach($nids as $nid) { $node = node_load($nid); $node->uid = 0; node_save($node); }