I am saving a popup modules settings and when is_popup is unchecked I receive the error below but it will still save the settings to the DB table, I don't get an error if checked.
ERROR when "is new target" is unchecked
Notice: Undefined index: is_popup in admin/model/design/popupbanner.php on line 48Notice: Undefined index: is_popup in admin/controller/extension/module/popupbanner.php on line 44Warning: Cannot modify header information - headers already sent by (output started at admin/controller/startup/error.php:34) in system/library/response.php on line 12
I've done some var_dumps and I can see is_popup is bringing back either Y or N so unsure why I'm getting undefined index.
MODEL - admin/controller/extension/module/popupbanner.php
43 $sql = "update `".DB_PREFIX."popupbanner_setting` set
44 `title` = '".$this->db->escape($all_post["title"])."',
45 `desc` = '".$this->db->escape($all_post["desc"])."',
46 `weblink` = '".$this->db->escape($all_post["weblink"])."',
47 `bannerfile` = '".$this->db->escape($all_post["bannerfile"])."',
48 `is_popup` = '".$this->db->escape($all_post["is_popup"] == "Y" ? "Y" : "N")."'
49 where `id` = '".$this->module_setting_id."'";
50 $rs = $this->db->query($sql);
51 }
CONTROLLER - admin/controller/extension/module/popupbanner.php
44 if($this_request_post["is_popup"] == ""){
45 $this_request_post["is_popup"] = "N";
46 }
VIEW -
<input type="checkbox" name="is_popup" value="Y" <?=($is_popup == "Y" ? "checked" : "")?> />
any help would be appreciated.