pluginsGLPI / order

Order plugin for GLPI
GNU General Public License v3.0
39 stars 44 forks source link

fix(massiveaction): use getter instead of cast object to array #314

Closed stonebuzz closed 2 years ago

stonebuzz commented 2 years ago

Since this PR https://github.com/glpi-project/glpi/pull/10975

And particulary this change https://github.com/glpi-project/glpi/pull/10975/files#diff-284b41ead4d268948c291846bcb61a98c51a0eebb76968e6d09a40b485909777

MassiveAction (to update reception status) no longer works

Originally plugin cast MassiveAction object to array to handle items key

      // from MassiveAction process, we get ma object, so convert it into array
      if (is_object($params)) {
         $ma      = $params;
         $params2 = (array) $params;
      }

But the variable is private now, it will have a weird key name (class + variable name) in the array.

Before https://github.com/glpi-project/glpi/pull/10975 Casting MassiveAction Object to array return this

["items"]=> array(1) { ["PluginOrderReception"]=> array(2) { [6]=> string(1) "6" [7]=> string(1) "7" }

Now it return this

["MassiveActionitems"]=> array(1) { ["PluginOrderReception"]=> array(2) { [6]=> string(1) "6" [7]=> string(1) "7" }

This PR use getter from MassiveAction Object

Fix internal !24000