Programmers Direct Posted August 7, 2015 Share Posted August 7, 2015 (edited) Hi everyone, I am working on a new free module and it seems that a list I am creating is missing soemthing and i cannot find what please can you look over the code to see what you think as it produces four notices two for type and two for value. below are the codes from the form. Errors Notice on line 424 in file /classes/db/Db.php [8] Undefined index: typeNotice on line 427 in file /classes/db/Db.php [8] Undefined index: valueNotice on line 424 in file /classes/db/Db.php [8] Undefined index: typeNotice on line 427 in file /classes/db/Db.php [8] Undefined index: value private function initToolbar() { $this->toolbar_btn = array( 'add' => array( 'href' => AdminController::$currentIndex.'&configure='.$this->name.'&add'.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules'), 'desc' => $this->l('Add')), 'remove' => array( 'href' => AdminController::$currentIndex.'&configure='.$this->name.'&remove'.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules'), 'desc' => $this->l('Remove') )); return $this->toolbar_btn; } protected function displayAddtoSelectionLink($token = null, $id, $name = null) { $tpl = $this->context->smarty->assign(array ( 'href' => AdminController::$currentIndex . '&' . $this->identifier . '=' . $id . '&add' . $this->table . '&token=' . ($token != null ? $token : $this->token), 'action' => $this->l('Add to Selection') )); return $tpl; } protected function displayRemoveSelectionLink($token = null, $id, $name = null) { $tpl = $this->context->smarty->assign(array ( 'href' => AdminController::$currentIndex . '&' . $this->identifier . '=' . $id . '&remove' . $this->table . '&token=' . ($token != null ? $token : $this->token), 'action' => $this->l('Remove from Selection') )); return $tpl; } protected function getCurrListForm() { return $this->fields_list = array ( 'id' => array ( 'title' => $this->l('Product Id'), 'width' => 150, 'align' => 'center', 'type' => 'text', 'list' => $this->initCurrList(), 'filter_key' => 'cl\!id', 'orderby' => false, 'search' => false, 'maxlength' => 90, 'tmpTableFilter' => false, 'havingFilter' => false, 'filter_type' => 'int', 'color' => '#FFFF00', 'hint' => $this->l('Product Ids.'), 'ajax' => false ), 'name' => array ( 'title' => $this->l('Product Name'), 'width' => 'auto', 'align' => 'center', 'type' => 'text', 'list' => $this->initCurrList(), 'filter_key' => 'cl\!name', 'orderby' => false, 'search' => false, 'maxlength' => 90, 'color' => '#FFFF00', 'hint' => $this->l('Selected Product Name'), 'ajax' => true), ); } private function initCurrList() { $options = array (); $sql = new DbQuery(); $sql->select('*'); $sql->from('category_product', 'cp'); $sql->leftJoin('product', 'p', 'p.id_product=cp.id_product'); $sql->leftJoin('product_lang', 'pl', 'pl.id_product=p.id_product AND pl.id_lang =' . $this->context->language->id); $sql->where('cp.id_category=' . (int)Configuration::get('HOME_FEATURED_CAT') . ' AND p.active=1'); $squery_data = Db::getInstance()->executeS($sql); foreach ($squery_data as $currlist_values) { $options[] = array ( 'id' => $currlist_values['id_product'], 'name' => $currlist_values['name'] ); } return $options; } protected function renderCurrList() { $helperlist = new HelperList(); $helperlist->shopLinkType = ''; $helperlist->title = 'Current Products for Home Featured Selection'; $helperlist->identifier = 'id'; $helperlist->table = $this->name.'_product'; $helperlist->simple_header = false; $helperlist->show_toolbar = true; $helperlist->currentIndex = AdminController::$currentIndex . '&configure=' . $this->name; $helperlist->token = Tools::getAdminTokenLite('AdminModules'); $helperlist->listTotal = count($this->initCurrList()); $helperlist->actions = array ('add', 'remove'); $helperlist->add = array ('add', $this->addToSelection(Tools::getAdminTokenLite('AdminModules'), $this->id), null); $helperlist->remove = array ('remove', $this->removeFromSelection(Tools::getAdminTokenLite('AdminModules'), $this->id), null); return $helperlist->generateList($this->initCurrList(), $this->getCurrListForm()); } Edited August 7, 2015 by ShopSaveNEarn (see edit history) Link to comment Share on other sites More sharing options...
Programmers Direct Posted August 12, 2015 Author Share Posted August 12, 2015 Wow no thoughts yet... I was sure this was a simple small issue. I still cannot solve this. I hope someone can help or just point me in the correct direction. Thanks, Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now