Revision 86833725
Added by Andreas Kohlbecker about 8 years ago
modules/cdm_dataportal/cdm_api/cdm_node.php | ||
---|---|---|
7 | 7 |
|
8 | 8 |
define('CDM_DRUPAL_NODE_CREATION', 'cdm_drupal_node_creation'); |
9 | 9 |
|
10 |
function do_create_drupal_nodes(){
|
|
10 |
function do_persist_drupal_nodes(){
|
|
11 | 11 |
static $value = null; |
12 | 12 |
if($value === NULL){ |
13 | 13 |
$value = variable_get(CDM_DRUPAL_NODE_CREATION, FALSE); |
... | ... | |
115 | 115 |
$title = substr($title, 0, 128); |
116 | 116 |
$node->title = $title; |
117 | 117 |
|
118 |
if(do_create_drupal_nodes()){ |
|
118 |
if(do_persist_drupal_nodes()){ |
|
119 |
|
|
119 | 120 |
// using the system admin user for all new nodes |
120 | 121 |
$node->uid = 0; |
121 | 122 |
|
... | ... | |
162 | 163 |
'cdmtype' => $nodetype, |
163 | 164 |
'uuid' => $uuid, |
164 | 165 |
))->execute(); |
166 |
} else { |
|
167 |
// Drupal node is not persisted |
|
168 |
// need to create fake nid |
|
169 |
$node->nid = 0; |
|
165 | 170 |
} |
166 | 171 |
} |
167 | 172 |
|
... | ... | |
202 | 207 |
|
203 | 208 |
cdm_add_node_content($node, $content); |
204 | 209 |
|
205 |
if(do_create_drupal_nodes()){
|
|
210 |
if(do_persist_drupal_nodes()){
|
|
206 | 211 |
// use the full node_show() |
207 | 212 |
$nodes = node_show($node); |
208 | 213 |
} else { |
Also available in: Unified diff
setting dummy node->nid for not persisted drupal nodes