So i've been having issues with a restservice that...
# cfml-general
j
So i've been having issues with a restservice that extends components in a completely different path. Everything works fine when I create a mapping within the admin, but when I create the mapping within the Application.cfc and remove the mapping in admin, everything breaks again. I recently stumbled across a post saying that you cannot extend components mapped via this.mappings in an Aplication.cfc. Is this the case? Do I have no remedy other than creating the mapping via the admin if I want to extend components? Is this an ACF(2023) only issue or does Lucee also have the issue?
m
The only issue I have run into related to this is that you can not extend your Application.cfc with a cfc that is in your mapped folder, since the mapping doesn't exist yet.
r
Is "Enable per Application Settings" checked in the admin?
j
indeed it is
c
@Jim Partin are you using the built-in REST stuff in ACF? Or are you doing REST using a framework such as Taffy, FW/1, or ColdBox?
j
built in
c
IIRC, the built-in REST stuff bypasses (or just doesn't use) Application.cfc or its settings. That's why mappings in CFAdmin work, but mappings in Application.cfc don't.
j
funny thing is, during testing of this issue, I can create an application level variable that the restservice can read. it just throws a fit when registering the service unless the mappings are done in the admin
c
Maybe it's just the pseudo-constructor stuff it doesn't use (any
this.xxxxxx
stuff). I also think some of the lifecycle methods don't run with REST.
q
BTW, the same behavior exists in Lucee too. Kinda a hack, but if you include an Application.cfc in your REST directory and just do :
component extends="../Application"
{
}
(or point to your main application.cfc file).. this will 'fix' the issue.