Needs review
Project:
CMIS API
Version:
7.x-1.2
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Reporter:
Created:
17 Jan 2012 at 05:51 UTC
Updated:
18 Feb 2017 at 17:54 UTC
Jump to comment: Most recent, Most recent file
When syncing a new node from Alfresco to Drupal, the following strict warning occurs:
Strict warning: Creating default object from empty value in _cmis_sync_cmis_drupal_prepare() (line 276 of C:\hubnet\drupal-7.10\sites\all\modules\cmis\cmis_sync\cmis_sync.cmis.inc).
The code in question is (in cmis_sync.cmis.inc):
// load Drupal node
$node = node_load($drupal_nid);
$node->type = $node_type;
This warning can be removed by changing this code to:
// load Drupal node
$node = node_load($drupal_nid);
if ($node === false) $node = (object) NULL;
$node->type = $node_type;
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | cmis_sync-default_object_warning-1407540-4.patch | 490 bytes | kimberleycgm |
Comments
Comment #1
IanNorton commentedHi,
I can't reproduce this, it's possible that it's been fixed as part of some other changes, but I'd like to confirm that by checking the settings that you've got in settings.php:
Can you also confirm that you're testing this with the latest 7.x-1.x-dev code branch?
Thanks,
Ian
Comment #2
soundasleep commentedSorry for not replying earlier, I hadn't configured Drupal.org to notify me of issue changes via e-mail...
Yes, this issue still occurs. Have you enabled E_ALL error notifications? In fact, we get two warnings:
However I independently rewrote my fix to satisfy another warning:
Excerpt from our settings.php:
Comment #3
brassington commentedI'm running into both of these warnings as well, but I'm using the 7.x-1.2 branch, from the fork provided by thehideki.
But when I implement the changes recommended above to cmis_sync.cmis.inc, I still don't have CMIS to Drupal syncing, but the error messages are gone.
Comment #4
kimberleycgmAdding a patch for the above - just create an empty object if the node doesn't already exist.