Icinga / icingaweb2-module-director

The Director aims to be your new favourite Icinga config deployment tool. Director is designed for those who want to automate their configuration deployment and those who want to grant their “point & click” users easy access to the configuration.
https://icinga.com/docs/director/latest
GNU General Public License v2.0
412 stars 201 forks source link

Deleting data list cause error when using PostgreSQL as backend #2913

Open afeefghannam89 opened 1 week ago

afeefghannam89 commented 1 week ago

Current Behavior

image

PostgreSQL is strict and does not do any magic typecasting. SQLServer does typecasting automagically. https://dev.mysql.com/doc/refman/8.4/en/type-conversion.html#:~:text=For%20example%2C%20MySQL%20automatically%20converts,as%20necessary%2C%20and%20vice%20versa.&text=It%20is%20also%20possible%20to,using%20the%20CAST()%20function.

That is why the Problem does not appear by MySQL users.

Possible Solution

change this

'l.id = dfs.setting_value',

to this

'CAST(l.id AS text) = dfs.setting_value',

in this file /usr/share/icingaweb2/modules/director/library/Director/Objects/DirectorDatalist.php (line 106):

Steps to Reproduce (for bugs)

create data list and use it. You should use PostgreSQL as backend. Try to delete the data list, you will get the same error above in the screenshot.

Your Environment

raviks789 commented 2 days ago

ref/IP/55374