dgowrie
-
Posts
6 -
Joined
-
Last visited
Posts posted by dgowrie
-
-
Can anyone help on this?
The first error was on line 143 and since I copied and pasted the code silkfire gave it now says error on line 159. I have no idea whether this is the same error and its moved from the code I put in or a new error?
Many Thanks
David
-
<snip removed copyrighted code>
-
Sorry for the double post but I've copied and pasted the code silk gave me and I've now got the same error but on a new line in the file. Line 159
I just don't know enough about PHP to fix this if it's a multiple thing so any additional help would be great.
Many Thanks
David
-
You get this error because you're trying to assign properties to an object that hasn't been declared previously. Your best way to solve it is to create an empty object (stdClass) and then put as the value of its respective key.
$slide_object = new stdClass; // Slide name if ($row->itemlink && $row->title) $slide_object->name = $row->title; //$row->name elseif ($row->menulink && $menuItem) $slide_object->name = $menuItem->name; //$row->name else $slide_object->name = $row->name; if (!$showName) $slide_object->name = ''; $output[$key] = $slide_object;
Sorry Silk but I have no idea what you have suggested or how I do it. Is the code you have posted what I need to add to the php file? If so where does it need to go?
Many Thanks
David
-
Hi all,
I have a website that is now showing an error message I have no clue about. I think I know the cause to be changing my web hosting php version from 5.2 to 5.4. I have now changed this back but i'm still getting the error:
Warning: Creating default object from empty value in /homepages/32/d291630191/htdocs/RCON/modules/mod_fpss/mod_fpss.php on line 143
I have attached the file it refers to, the website to see the error is www.renovoconstruction.co.uk
If anyone could help it would be greatly appreciated
Many Thanks,
David
<snip removed attached file>
Warning: Creating Default Object From Empty Value
in Third Party Scripts
Posted
Haha, sorry social. Lines 142 to 160 are below:
// Compare display options between component and module
$showName = ($fpssSlideTitle=='') ? $row->showtitle : $fpssSlideTitle;
$showSectionTitle = ($fpssSlideSec=='') ? $row->showseccat : $fpssSlideSec;
$showCategoryTitle = ($fpssSlideCat=='') ? $row->showseccat : $fpssSlideCat;
$showText = ($fpssSlideText=='') ? $row->showcustomtext : $fpssSlideText;
$showTagline = ($fpssSlideTagline=='') ? $row->showplaintext : $fpssSlideTagline;
$showReadMore = ($fpssSlideReadMore=='') ? $row->showreadmore : $fpssSlideReadMore;
// Get menu data
if($row->menulink) $menuItem = $menu->getItem($row->menulink);
// Slide name
if($row->itemlink && $row->title){
$output[$key]->name = $row->title; //$row->name
} elseif($row->menulink && $menuItem){
$output[$key]->name = $menuItem->name; //$row->name
} else {
$output[$key]->name = $row->name;
}