Skip Navigation
Post upgrade, CPMs error with "Trying to get property of non-object"
Answer ID 9256   |   Last Review Date 12/24/2018

Why is my PHP code showing an error "Trying to get property of non-object", post-upgrade to November 2016?


Oracle Cloud Service November 2016 release


Check objects using if(isset(...)) before instantiating them.

Sample code:

Replace  $sample = $object->Contact;  


if(isset($object)) {

$sample = $object->Contact;



 Along with the upgrade to November 2016, there is an upgrade to the PHP version as well.

The new PHP version is stricter than the older ones and requires objects to be checked before they are referenced into the code.

Available Languages for this Answer:

Notify Me
The page will refresh upon submission. Any pending input will be lost.