Skip to content

Instantly share code, notes, and snippets.

@orthagh
Created December 8, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save orthagh/e466425d51cedf2986a3 to your computer and use it in GitHub Desktop.
Save orthagh/e466425d51cedf2986a3 to your computer and use it in GitHub Desktop.
force entities_id mandatory
diff --git a/inc/commondbtm.class.php b/inc/commondbtm.class.php
index 492dcb7..1aa9e01 100644
--- a/inc/commondbtm.class.php
+++ b/inc/commondbtm.class.php
@@ -981,6 +981,9 @@ class CommonDBTM extends CommonGLPI {
* @return the modified $input array
**/
function addNeededInfoToInput($input) {
+ if (!isset($input['entities_id'])) {
+ $input['entities_id'] = $_SESSION['glpiactive_entity'];
+ }
return $input;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment