Commit f0166d6b authored by Julian Bouzas's avatar Julian Bouzas
Browse files

policy: fix removing of item links when linkable is removed

parent ba6404f7
Pipeline #318688 passed with stages
in 1 minute and 6 seconds
......@@ -198,13 +198,11 @@ function unhandleSiLinkable (si)
-- remove any links associated with this item
for silink in silinks_om:iterate() do
local out_id = tostring (silink.properties["out.item.id"])
local in_id = tostring (silink.properties["in.item.id"])
for si in silinkables_om:iterate() do
if out_id == si.id or in_id == si.id then
silink:remove ()
Log.info (silink, "link removed")
end
local out_id = tonumber (silink.properties["out.item.id"])
local in_id = tonumber (silink.properties["in.item.id"])
if out_id == si.id or in_id == si.id then
silink:remove ()
Log.info (silink, "link removed")
end
end
end
......
......@@ -239,13 +239,11 @@ function unhandleSiLinkable (si)
-- remove any links associated with this item
for silink in silinks_om:iterate() do
local out_id = tostring (silink.properties["out.item.id"])
local in_id = tostring (silink.properties["in.item.id"])
for si in silinkables_om:iterate() do
if out_id == si.id or in_id == si.id then
silink:remove ()
Log.info (silink, "link removed")
end
local out_id = tonumber (silink.properties["out.item.id"])
local in_id = tonumber (silink.properties["in.item.id"])
if out_id == si.id or in_id == si.id then
silink:remove ()
Log.info (silink, "link removed")
end
end
end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment