Fatal error: Call to a member function getAddress1() on a non-object in /var/www/vhosts/xxxxxx.com/httpdocs/page_types/real_estate_listing.php
Permalink Browser Info Environment
When clicking "Page Type > Property Listing > Default" I receive the following error message?
Fatal error: Call to a member function getAddress1() on a non-object in /var/www/vhosts/xxxxxx.com/httpdocs/page_types/real_estate_listing.php
Please help!
Fatal error: Call to a member function getAddress1() on a non-object in /var/www/vhosts/xxxxxx.com/httpdocs/page_types/real_estate_listing.php
Please help!
Type: | Discussion |
---|---|
Status: | New |
Hi Tony,
I've renamed the customised real_estate_listing.php. Please view below the resulting error message.
Fatal error: Call to a member function getAddress1() on a non-object in /var/www/vhosts/xxxxxx.com/httpdocs/packages/tony_real_estate/page_types/real_estate_listing.php on line 89
I've renamed the customised real_estate_listing.php. Please view below the resulting error message.
Fatal error: Call to a member function getAddress1() on a non-object in /var/www/vhosts/xxxxxx.com/httpdocs/packages/tony_real_estate/page_types/real_estate_listing.php on line 89
so looking at the original code for that real_estate_listing.php page type, there isn't actually any reference to that getAddress1() around there. Did you make some changes on original that version too?
Hi Tony,
It is unclear whether the original real_estate_listing.php was edited as the site was developed by a previous developer colleague who has now since moved on.
It is unclear whether the original real_estate_listing.php was edited as the site was developed by a previous developer colleague who has now since moved on.
I checked, and that did look like it had been edited at some point. I uploaded a change to your site to make sure that object existed before trying to call a method on it.
The original file tests for the existence of that object before trying to call a method on it, so this type of error message should be prevented:
<? if( is_object($address) ){ ?>
<h1 class="address">
<? if( strlen(trim($address->getAddress1()).trim($address->getAddress1())) ){ ?>
I'm wondering if you customized this file in a way that no longer does this is_object check?