Post by fisher05 » Sun Apr 28, 2019 3:49 am

I am saving a popup modules settings and when is_popup is unchecked I receive the following error but it will still save the settings, I don't get an error if checked. I don't understand why I'm getting undefined index.

error when 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

admin/model/design/popupbanner.php

Code: Select all

$sql = "update `".DB_PREFIX."popupbanner_setting` set
        `title` = '".$this->db->escape($all_post["title"])."',
        `desc` = '".$this->db->escape($all_post["desc"])."',
        `weblink` = '".$this->db->escape($all_post["weblink"])."',
        `bannerfile` = '".$this->db->escape($all_post["bannerfile"])."',
        `is_popup` = '".$this->db->escape($all_post["is_popup"] == "Y" ? "Y" : "N")."'
          where `id` = '".$this->module_setting_id."'";
$rs = $this->db->query($sql);
}
admin/controller/extension/module/popupbanner.php

Code: Select all

if($this_request_post["is_popup"] == ""){
  $this_request_post["is_popup"] = "N";
}
VIEW

Code: Select all

<input type="checkbox" name="is_popup" value="Y" <?=($is_popup == "Y" ? "checked" : "")?> />
VARDUMP on $sql
string(188) "update `popupbanner_setting` set `title` = 'Test', `desc` = '', `weblink` = '', `bannerfile` = '', `is_popup` = 'Y' where `id` = '1'"
string(188) "update `popupbanner_setting` set `title` = 'Test', `desc` = '', `weblink` = '', `bannerfile` = '', `is_popup` = 'N' where `id` = '1'"

Fisher05


User avatar
New member

Posts

Joined
Wed May 22, 2013 1:30 am

Post by JNeuhoff » Sun Apr 28, 2019 7:12 pm

This is about a 3rd party extension. You need to get in touch with the author of this extension. It's not an OpenCart issue.

MHC Web Design
Override Engine * Integrated VQMod * Unused Images Manager * Instant Option Price Calculator * TrustPilot Reviews * Google Rich Snippets * Google Tag Manager * Export/Import Tool * Template Switcher PHP/Twig


User avatar
Expert Member

Posts

Joined
Wed Dec 05, 2007 3:38 am

Who is online

Users browsing this forum: No registered users and 11 guests