Undefined index screen_width for my calendar

Hi guys,
In my …/suiteCrm/index.php?module=Calendar&action=index&parentTab=All , it notices undefined index screen_width of $_SESSION. I’de like to discuss with you my solution.

I added if(array_key_exists(“screen_width”,$_SESSION)) before if($_SESSION[‘screen_width’] < 640 && isset($_SESSION[‘screen_width’])) and for my else I added the same previous else ( $_SESSION[‘CALENDAR_VIEW’] = $_REQUEST[‘view’]:wink: .

What do you think about my idea ?!

Regards.

Hi Zakaria,

i just added isset($_SESSION[‘screen_width’] ) in if condition. it works fine.

i-e
if(isset($_SESSION[‘screen_width’] ) && $_SESSION[‘screen_width’] < 640 && isset($_SESSION[‘screen_width’])){
// $_SESSION[‘CALENDAR_VIEW’] = “mobile”;
$_REQUEST[‘view’] = “mobile”;
}else{
$_SESSION[‘CALENDAR_VIEW’] = $_REQUEST[‘view’];
}

Regards
Adeel Zauq