I'm programmatically creating a new node using Entity Metadata Wrapper.
How to check if last instruction:
$ewrapper->save(); creates correctly the new node without errors?
I'm programmatically creating a new node using Entity Metadata Wrapper.
How to check if last instruction:
$ewrapper->save(); creates correctly the new node without errors?
Check that the entity has an identifier:
if ($ewrapper->getIdentifier()) { // Save happened. } A better approach might be handling any errors:
try { $ewrapper->save(); // Try to do something with $ewrapper->getIdentifier() } catch (\Exception $e) { // Recover... } Try to chech the following: $wrapper->getIdentifier(), it should return nid of new node.