summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2012-01-19 21:10:27 +0000
committerTed Trask <ttrask01@yahoo.com>2012-01-21 15:52:19 +0000
commitbdc921ce195b3037c8b2fe650e30f2e7bd979e81 (patch)
treea2a57b83716514df8ad12058d15f9cbf167ef6db /lib
parent50599742e1592677bb45c91dc6c5e7772abad791 (diff)
downloadacf-core-bdc921ce195b3037c8b2fe650e30f2e7bd979e81.tar.bz2
acf-core-bdc921ce195b3037c8b2fe650e30f2e7bd979e81.tar.xz
Fixed bug in roles where last matching controller used, rather than first
(cherry picked from commit 1e53255088385fcfe49747202227d30a76e08c89)
Diffstat (limited to 'lib')
-rw-r--r--lib/roles.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/roles.lua b/lib/roles.lua
index 7c69724..8cc5332 100644
--- a/lib/roles.lua
+++ b/lib/roles.lua
@@ -52,7 +52,9 @@ get_controllers = function(self,pre,controller)
filename = string.match(v,"[^/]*.lua")
name = string.match(filename,"[^.]*")
sname = string.match(filename,"[^-]*")
- temp[prefix..sname] = {path=path,prefix=prefix,filename=filename,name=name,sname=sname}
+ if not temp[prefix..sname] then -- only keep the first of each
+ temp[prefix..sname] = {path=path,prefix=prefix,filename=filename,name=name,sname=sname}
+ end
end
if pre and controller then
return temp[pre..controller]