We’re trying to migrate application away from Adobe and have things working but have a few weird issues we’re working through and just stumbled on this. We make heavy use of initMethod in components (this code was written long before I got here) and it seems like Lucee doesn’t support that. I found an old ticket from 2015: Jira
Would this be a heavy lift to add? I think the alternative is we’d have to refactor 190+ components to use init()…
Is there any chance that they all extend a base-component that could turn around and call initMethod() in the “super” init() method as a stop-gap? I think under the hood, all CFCs extend some hidden CFC (or maybe that’s only in ACF?) - maybe you could do something like that there.
2 Likes
I’ve been using CF for over 27 years and have never heard of initMethod(). Could you not just replace all instances with init()?
BTW: I would love to see the use of initMethod() and how you called your CFC in CF 
1 Like
yeah, we aren’t going to implement this, it adds overhead and the gymnastics to maintain backwards compatibility aren’t worth it
I’ve added the following exception to 6.2.4 and 7.0.1
Checking initmethod attribute for component
Errored: Attribute [initMethod] is not supported in Lucee. Refactor your code to use the default init() method.
D:\work\lucee6\test\tickets\LDEV0296\child.cfc:14
D:\work\lucee6\test\tickets\LDEV0296\index.cfm:2
D:\work\lucee6\test\tickets\LDEV0296.cfc:8
D:\work\lucee6\test\_testRunner.cfc:296
D:\work\lucee6\test\run-tests.cfm:351
lucee.runtime.exp.TemplateException: Attribute [initMethod] is not supported in Lucee.
Refactor your code to use the default init() method.
at lucee.transformer.cfml.evaluator.impl.Component.evaluate(Component.java:130)
at lucee.transformer.cfml.evaluator.EvaluatorSupport.evaluate(EvaluatorSupport.java:73)
at lucee.transformer.cfml.evaluator.EvaluatorPool.run(EvaluatorPool.java:79)
at lucee.transformer.cfml.tag.CFMLTransformer.transform(CFMLTransformer.java:376)
at lucee.transformer.cfml.tag.CFMLTransformer.transform(CFMLTransformer.java:340)`
and docs updated with the unimplemented status
2 Likes