Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Projects > The Bug Tracker > Bug

Notices

class_language.php cause PHP Notice on Undefined variable $controller Issue Tools
issueid=36 01-22-2014 02:59 PM
Member
class_language.php cause PHP Notice on Undefined variable $controller

In some cases the $control is undefined and this can cause a PHP Notice.
Its not urgent but annoying when going thru error_log

Code:
--- v1.3.4/classes/class_language.php	2013-04-18 19:42:30.000000000 +0200
+++ src/classes/class_language.php	2014-01-21 21:26:09.000000000 +0100
@@ -105,6 +105,7 @@
      */	
     private function locate($file){
         $mysidia = Registry::get("mysidia");
+        $controller = '';
         if($mysidia->input->get("frontcontroller") != "index"){
             $controller = "{$mysidia->input->get("frontcontroller")}/";
         }
Issue Details
Project The Bug Tracker
Category Unknown
Status Fixed
Priority 8
Affected Version Mys v1.3.4
Fixed Version Mys v1.4.0
Users able to reproduce bug 0
Users unable to reproduce bug 0
Assigned Users (none)
Tags (none)

01-27-2014 02:00 AM
Administrator, Lead Coder
 
Notice errors are caused by not checking the existence of variables at first. In Mys v1.3.4, the notice error ususally occurs with PHP native strings. In Mys v1.4.0, almost everything is an object so you wont get notice errors. Most people do not have notice errors enabled on their web servers though, so only users with their own servers will likely to ever receive them.

Anyway just like the OP suggested, the easiest way to get rid of notice errors is to simply define the missing variable to be an empty string or even NULL at the very beginning.
Reply
01-27-2014 02:48 AM
Member
 
is the version 1.4.0 already available?
Reply
01-27-2014 05:28 AM
Administrator, Lead Coder
 
Nope, its months away from available.
Reply
Reply

Issue Tools
Subscribe to this issue

All times are GMT -5. The time now is 09:31 PM.

Currently Active Users: 461 (0 members and 461 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636