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!

Type: Discussion
Status: New
hudsonarmstrong
View Replies:
Tony replied on at Permalink Reply
Tony
so you're overriding the real_estate_listing.php page type in order to customize the display then? If you temporarily move that file or rename it do you experience the same error? if so, then can you tell me the line number of the error after reverting to the original file?

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?
hudsonarmstrong replied on at Permalink Reply
hudsonarmstrong
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
Tony replied on at Permalink Reply
Tony
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?
hudsonarmstrong replied on at Permalink Reply
hudsonarmstrong
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.
Tony replied on at Permalink Reply
Tony
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.

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.