Icinga / icingaweb2-module-businessprocess

Create top-level views of your applications in a graphical editor. Rules express dependencies between existing hosts and services and let you alert on application level. Business processes are displayed in a tree or list overview.
https://icinga.com/docs/businessprocess/latest
GNU General Public License v2.0
108 stars 44 forks source link

D&D for subprocess doesn't work #404

Open yhabteab opened 1 year ago

yhabteab commented 1 year ago

Describe the bug

Trying to reorder the children that also contain a subprocess results to this error:

Bildschirmfoto 2023-08-15 um 09 56 18
yhabteab commented 1 year ago

How to reproduce

  1. Create a top-level process
  2. Add some children
  3. Store the config
  4. Add a new process as a subprocess
  5. Try to reorder the new created subprocess
sukhwinder33445 commented 1 year ago

This error occurs when the ID of the newly added subprocess is an int (step 4 above).

NodeMoveAction::applyTo() uses array_merge(), which reset array key if $name is int.

https://github.com/Icinga/icingaweb2-module-businessprocess/blob/master/library/Businessprocess/Modification/NodeMoveAction.php#L171-L175