File tree Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Original file line number Diff line number Diff line change 1
1
name = OS2Web Case Publishing Service
2
2
description = This feature provides the content publishing services. Requires a publishing plugin
3
3
core = 7.x
4
- package = OS2Web
4
+ package = OS2Web - Frontend
5
5
php = 5.2.4
6
6
version = 7.x-0.1
7
7
project = os2web_cp_service
Original file line number Diff line number Diff line change @@ -466,17 +466,19 @@ function os2web_cs_service_create_document(array $data) {
466
466
$nids = array_keys($result['node']);
467
467
foreach ($nids as $nid) {
468
468
$cnode = node_load($nid);
469
- $node->field_os2web_cp_service_case_id[LANGUAGE_NONE][]['value'] = $cnode->field_os2web_cp_service_case_id[LANGUAGE_NONE][0]['value'];
470
- node_save($node);
471
- $is_missing = TRUE;
472
- foreach ($cnode->field_os2web_cp_service_doc_ref[LANGUAGE_NONE] as $value) {
473
- if ($value['target_id'] == $node->nid) {
474
- $is_missing = FALSE;
469
+ if (!empty($cnode)) {
470
+ $node->field_os2web_cp_service_case_id[LANGUAGE_NONE][]['value'] = $cnode->field_os2web_cp_service_case_id[LANGUAGE_NONE][0]['value'];
471
+ node_save($node);
472
+ $is_missing = TRUE;
473
+ foreach ($cnode->field_os2web_cp_service_doc_ref[LANGUAGE_NONE] as $value) {
474
+ if ($value['target_id'] == $node->nid) {
475
+ $is_missing = FALSE;
476
+ }
477
+ }
478
+ if ($is_missing) {
479
+ $cnode->field_os2web_cp_service_doc_ref[LANGUAGE_NONE][]['target_id'] = $node->nid;
480
+ node_save($cnode);
475
481
}
476
- }
477
- if ($is_missing) {
478
- $cnode->field_os2web_cp_service_doc_ref[LANGUAGE_NONE][]['target_id'] = $node->nid;
479
- node_save($cnode);
480
482
}
481
483
}
482
484
}
You can’t perform that action at this time.
0 commit comments