bonsaiko Posted January 1, 2018 Share Posted January 1, 2018 Hello, I created my own module, working with a specific table that I created. I have an admin controller working almost fine. I can add new items, edit them but I'm not able to delete them. When I click on the delete item button, nothing happens. Here's my construct function: public function __construct() { // Set variables $this->table = 'ki_auteur'; $this->className = 'KiModAuteurs'; // Call of the parent constructor method parent::__construct(); $this->fields_list = array( 'id_auteur' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'auteur_lastname' => array('title' => $this->l('Lastname'), 'width' => 140), 'auteur_firstname' => array('title' => $this->l('Firstname'), 'width' => 140), 'date_add' => array('title' => $this->l('Date added'), 'type' => 'date'), ); $this->_defaultOrderBy = 'auteur_lastname'; $this->_defaultOrderWay = 'ASC'; // Set fields form for form view $this->context = Context::getContext(); $this->context->controller = $this; $this->addRowAction('view'); $this->addRowAction('edit'); $this->addRowAction('delete'); $this->bulk_actions = array( 'delete' => array( 'text' => $this->l('Delete selected'), 'confirm' => $this->l('Would you like to delete the selected items?'), ) ); // Enable bootstrap $this->bootstrap = true; } Is there something else I need to do ? Is there another function that I must create to take care of the deletion ? Thanks for your help. Link to comment Share on other sites More sharing options...
bonsaiko Posted January 4, 2018 Author Share Posted January 4, 2018 Hello, Is ther anyone willing to help me ? I'm really stuck... Link to comment Share on other sites More sharing options...
Pierre_d Posted January 11, 2018 Share Posted January 11, 2018 Have you tried to debug the code to see what happens ? I've a similar kind of module and delete happens as expected. Link to comment Share on other sites More sharing options...
bonsaiko Posted January 11, 2018 Author Share Posted January 11, 2018 Hello Pierre, I set up _PS_MOD_DEV_ to true but when I click on the delete button, it asks me for confimation, then I click on "yes" (to confirm that I want to delete the item) and then it reloads the page but nothing was deleted and no error message... Any idea of where to look and how to debug this, as I have no error message ? I really appreciate your help, thank you Pierre. Link to comment Share on other sites More sharing options...
Pierre_d Posted January 12, 2018 Share Posted January 12, 2018 Hi, I was referring to a PHP debugger. I have a local development environment with a Ubuntu server. On the client, I use Netbeans IDE. I've installed XDebug on the server. When I start the debugger, I can follow the PHP execution step-by-step in the source code and see what happens. This is by far the best way to find your way within PHP in general and Prestashop. Are you familiar with this kind of debugger ? This is a must have! Link to comment Share on other sites More sharing options...
bonsaiko Posted January 12, 2018 Author Share Posted January 12, 2018 Hello Pierre, I personnaly use phpstorm as IDE. I have xampp as local server but I don't use Xdebug, I think i heard it doesn't work with xampp. I think I should install another local server instead of xampp, to be able to debug. 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