diff --git a/src/scripts/linking/find-defined-target.lua b/src/scripts/linking/find-defined-target.lua index bc714da8..809a7ebe 100644 --- a/src/scripts/linking/find-defined-target.lua +++ b/src/scripts/linking/find-defined-target.lua @@ -102,6 +102,7 @@ SimpleEventHook { end end + si_flags.has_defined_target = false if target_picked and target then log:info (si, string.format ("... defined target picked: %s (%s), can_passthrough:%s", @@ -110,6 +111,7 @@ SimpleEventHook { tostring (can_passthrough))) si_flags.has_node_defined_target = node_defined si_flags.can_passthrough = can_passthrough + si_flags.has_defined_target = true event:set_data ("target", target) elseif target_value and dont_fallback then -- send error to client and destroy node if linger is not set diff --git a/src/scripts/linking/get-filter-from-target.lua b/src/scripts/linking/get-filter-from-target.lua index a6673b2a..e17de37a 100644 --- a/src/scripts/linking/get-filter-from-target.lua +++ b/src/scripts/linking/get-filter-from-target.lua @@ -35,11 +35,17 @@ SimpleEventHook { return end - -- Get the filter from the given target, if any + -- Get the filter from the given target if it exists, otherwise get the + -- default filter, but only if target was not defined local target_direction = cutils.getTargetDirection (si.properties) local filter_target = futils.get_filter_from_target (target_direction, target) if filter_target ~= nil then target = filter_target + elseif filter_target == nil and not si_flags.has_defined_target then + filter_target = futils.get_filter_from_target (target_direction, nil) + if filter_target ~= nil then + target = filter_target + end end local can_passthrough, passthrough_compatible