Notice: Trying to get property of non-object in include...

makis_stavropoulos's picture
makis_stavropoulos
Mon, 11/30/2015 - 13:22
#1
Notice: Trying to get property of non-object in include...

hello i just bought your theme and in a fresh install i get this msg:

Notice: Trying to get property of non-object in include() (line 25 of C:\xampp\htdocs\fork3\sites\all\modules\custom\md_block_custom\add\template\userinfo.tpl.php).

any advice?

phuonght's picture
phuonght
Mon, 11/30/2015 - 22:35

Hi,

In file userinfo.tpl.php, line 25:

replace

$user_image_alt= $user->picture->alt;

with

if ($user->picture) {
$user_image_alt= $user->picture->alt;
} else {
$user_image_alt = t("User no image");
}

and replace line 52 with

echo '<img src="' . $base_url . '/' . drupal_get_path('module', 'md_block_custom') . '/add/img/user_not_verified.png" alt="'. $user_image_alt .'" class="img-circle user-avatar" />';
makis_stavropoulos's picture
makis_stavropoulos
Mon, 12/14/2015 - 10:53

thank you for the quick answer. the theme is very beautifull but its quite buggy. i have 2 issues. firstly i cannot add a custom css class in a view's field. secondly all of a sudden, the cart icon in the uper right corner is lost and in its place there is an unkonwn to me symbol. any advice?

phuonght's picture
phuonght
Mon, 12/14/2015 - 22:05

Coud you send us your site url, admin account and FTP account by Private comment? We would like to have a check in your site. 

phuonght's picture
phuonght
Tue, 12/15/2015 - 05:48

1. Please tell us which view you could not add custom class or all views?

You could add class for a view by: open view > advance setting > Other => add custom class in CSS Class

2. Please go to /admin/config/media/icon check if you enable or import icon in right way. 

Image title

If everything is ok but problems still exit, please try to upload your site to any host so we can check exactly which reason is and find some solutions.

phuonght's picture
phuonght
Tue, 12/15/2015 - 23:00

In addition,

with missing cart icon problem, you could try below solution also:
open file sites\all\themes\md_hosoren\theme_setting\front\page.preprocess.inc

after line 6: 

function md_hosoren_preprocess_page(&$vars, $hook) {

insert 

// CALL FONT ICON
$call_icon_font[] = array(
'#theme' => 'icon',
'#bundle' => 'theme_font',
'#icon' => 'icon-floppy',
);
drupal_render( $call_icon_font);

Save and clear cache.

Log in or register to post comments
Have More Idea?

We are here to build your website!

No Universal solution fits all special business requirements. Our experienced team is ready with ideas and state-of-the-art technical solutions to consult the best solution within your budget.