Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
GLPI
glpi
Commits
6d88b163
Commit
6d88b163
authored
May 06, 2019
by
Cédric Anne
Committed by
Johan Cwiklinski
May 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix network IP adresses list; fixes #5865 (#5866)
* Fix network IP adresses list; fixes #5865 * [fixup] Fix typo
parent
b34267e5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
inc/ipaddress.class.php
inc/ipaddress.class.php
+7
-5
tests/units/DBmysqlIterator.php
tests/units/DBmysqlIterator.php
+6
-4
No files found.
inc/ipaddress.class.php
View file @
6d88b163
...
...
@@ -1162,8 +1162,10 @@ class IPAddress extends CommonDBChild {
'ON'
=>
[
'NAME'
=>
'items_id'
,
'PORT'
=>
'id'
,
[
'NOT'
=>
[
'PORT.itemtype'
=>
$CFG_GLPI
[
'networkport_types'
]
'AND'
=>
[
'NOT'
=>
[
'PORT.itemtype'
=>
$CFG_GLPI
[
'networkport_types'
]
]
]
]
]
...
...
@@ -1193,13 +1195,13 @@ class IPAddress extends CommonDBChild {
$queries
[]
=
$criteria
;
$criteria
=
$main_criteria
;
$criteria
[
'SELECT'
]
=
$criteria
[
'SELECT'
]
+
[
$criteria
[
'SELECT'
]
=
array_merge
(
$criteria
[
'SELECT'
]
,
[
new
\
QueryExpression
(
"NULL AS name_id"
),
new
\
QueryExpression
(
"NULL AS port_id"
),
new
\
QueryExpression
(
'NULL AS item_id'
),
new
\
QueryExpression
(
"NULL AS item_type"
)
];
$criteria
[
'INNER JOIN'
][
'glpi_ipaddresses AS ADDR'
][
'ON'
][
0
][
'AND'
][
'ADDR.itemtype'
]
=
[
'!'
,
'NetworkName'
];
]
)
;
$criteria
[
'INNER JOIN'
][
'glpi_ipaddresses AS ADDR'
][
'ON'
][
0
][
'AND'
][
'ADDR.itemtype'
]
=
[
'!
=
'
,
'NetworkName'
];
$queries
[]
=
$criteria
;
$union
=
new
\
QueryUnion
(
$queries
);
...
...
tests/units/DBmysqlIterator.php
View file @
6d88b163
...
...
@@ -950,8 +950,8 @@ class DBmysqlIterator extends DbTestCase {
AND `NAME`.`itemtype` = 'NetworkPort')
INNER JOIN `glpi_networkports` AS `PORT`
ON (`NAME`.`items_id` = `PORT`.`id`
NOT `PORT`.`itemtype`
IN ('"
.
implode
(
"', '"
,
$CFG_GLPI
[
"networkport_types"
])
.
"'))
AND
NOT
(
`PORT`.`itemtype`
IN ('"
.
implode
(
"', '"
,
$CFG_GLPI
[
"networkport_types"
])
.
"'))
)
LEFT JOIN `glpi_entities` ON (`ADDR`.`entities_id` = `glpi_entities`.`id`)
WHERE `LINK`.`ipnetworks_id` = '42')"
;
...
...
@@ -1103,8 +1103,10 @@ class DBmysqlIterator extends DbTestCase {
'ON'
=>
[
'NAME'
=>
'items_id'
,
'PORT'
=>
'id'
,
[
'NOT'
=>
[
'PORT.itemtype'
=>
$CFG_GLPI
[
'networkport_types'
]
'AND'
=>
[
'NOT'
=>
[
'PORT.itemtype'
=>
$CFG_GLPI
[
'networkport_types'
]
]
]
]
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment