1. Home
  2. Knowledge Base
  3. Problems (EN)
  4. Widgets are not deleted correctly in dashboards v 6.0

Widgets are not deleted correctly in dashboards v 6.0

The solution at this problem is add the next query to Pandora FMS database:

set @var=if((SELECT true
FROM information_schema.TABLE_CONSTRAINTS
WHERE CONSTRAINT_SCHEMA = DATABASE()
AND TABLE_NAME = 'twidget_dashboard'
AND CONSTRAINT_NAME = 'twidget_dashboard_ibfk_2'
AND CONSTRAINT_TYPE = 'FOREIGN KEY') = true,
'ALTER TABLE twidget_dashboard DROP FOREIGN KEY twidget_dashboard_ibfk_2',
'SELECT 0');
prepare stmt from @var;
execute stmt;
deallocate prepare stmt;

For its execution we could create a .sql file with the contain added. Supposing that is called query.sql this will be its execution into the command line:

 cat query.sql | mysql -u root -p -D pandora
 password:

Once applied it, edit and delete of widgets will work correctly.

Was this article helpful?

Related Articles

Need Support?

Can't find the answer you're looking for?
Contact Support

Recent Discussions