FOGProject / fogproject

An open source computer cloning & management system
https://fogproject.org
GNU General Public License v3.0
1.14k stars 222 forks source link

[FOG 1.6] Location association #360

Open gplamondon opened 4 years ago

gplamondon commented 4 years ago

Unable to change Location on hosts. When making the change it adds an entry instead of updating the current entry. I found there were two entries for the host in locationAssoc

mastacontrola commented 4 years ago

I'm unable to replicate this issue.

Looking at Hosts -> Plugin -> Location Associations, I only have a select box. When I update the record updates accordingly:

mysql> select * from locationAssoc;
+------+--------------+----------+
| laID | laLocationID | laHostID |
+------+--------------+----------+
|   19 |            1 |       18 |
+------+--------------+----------+
1 row in set (0.00 sec)

mysql> select * from locationAssoc;
+------+--------------+----------+
| laID | laLocationID | laHostID |
+------+--------------+----------+
|   19 |            2 |       18 |

This is doing it from the host.

Similarly, going to the Locations and choosing the same host:

mysql> select * from locationAssoc;
Empty set (0.00 sec)

mysql> select * from locationAssoc;
+------+--------------+----------+
| laID | laLocationID | laHostID |
+------+--------------+----------+
|   19 |            1 |       18 |
+------+--------------+----------+
1 row in set (0.00 sec)

mysql> select * from locationAssoc;
+------+--------------+----------+
| laID | laLocationID | laHostID |
+------+--------------+----------+
|   19 |            2 |       18 |
+------+--------------+----------+
1 row in set (0.00 sec)
gplamondon commented 4 years ago

I ran this query before updating a host location.

MariaDB [fog]> select * from locationAssoc WHERE locationAssoc.laHostID = 926;
+------+--------------+----------+
| laID | laLocationID | laHostID |
+------+--------------+----------+
|  494 |            8 |      926 |
+------+--------------+----------+
1 row in set (0.00 sec)

After the update...

MariaDB [fog]> select * from locationAssoc WHERE locationAssoc.laHostID = 926;
+------+--------------+----------+
| laID | laLocationID | laHostID |
+------+--------------+----------+
|  494 |            8 |      926 |
|  905 |           25 |      926 |
+------+--------------+----------+
2 rows in set (0.00 sec)
mastacontrola commented 4 years ago

I don't disbelieve you, I just don't have a way to replicate the problem you're seeing.

Not exactly sure how to address currently.

mastacontrola commented 4 months ago

Similar to the blank tasks item, i think this may be fixed, but I'm not 100% sure. If you're still willing to test and let me know?

Thank you!