Autowire remote proxies, changed to manual instead of automatic

Description

UPDATE
The original feature introduces problems when doing testing and when leveraging ORM event handling. Please see comments.

Description
Automatically autowire remote proxies so they can automatically take advantage of mixins and AOP. Since "this" in a super class's pseduo constructor is a reference to the super class and not the sub class, use the cgi.script_name to determine the path of the proxy and get the metadata from there.

Gliffy Diagrams

Activity

Show:

Brad WoodMarch 29, 2016 at 9:28 PM

Can you show me specifically how to reproduce the problem scenario so I can try and resolve this? I think we just need to improve the detection that tries to see if we're running a remote CFC directly.

Brad WoodMarch 29, 2016 at 9:11 PM
Edited

I wonder if the code above just needed to be modified. Did your tests hit a CFC file directly in the URl to run? The only way autowire should run is if a CFC is being hit directly.

Did you test your fix? It doesn't work. See my comments in Github, The base class runs its pseudo constructor first, which means setting `this.autowire` in the sub class is never read. We're going to have to back out your "fix' or it will permanently break anyone's code using autowired proxies.

Luis MajanoMarch 29, 2016 at 8:18 PM

It was still kicking in for Entities (ORM objects)

Brad WoodMarch 29, 2016 at 7:16 PM
Edited

What kind of issues were happening? The code was already set up to only fire for explicit access to a CFC from the URL. If you're simply extending the proxy, the autowire shouldn't have been kicking in:

// Only process this logic if hitting a remote proxy CFC directly if( len( script_name ) < 5 || right( script_name, 4 ) != '.cfc' ) { return; }

Luis MajanoMarch 10, 2016 at 8:26 PM

That's a very good point

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Fix versions

Affects versions

Priority

Sentry

Created February 4, 2014 at 6:12 AM
Updated March 29, 2016 at 9:28 PM
Resolved March 10, 2016 at 6:45 PM

Flag notifications