[ColdBox-4.3.0]: Private event not working?

31 views
Skip to first unread message

Ancient Programmer

unread,
Apr 2, 2017, 11:35:43 AM4/2/17
to ColdBox Platform
Guys

What does it mean by "private event"? I wrote some code to test it, but it didn't work as I expected.



// /handlers/Test.cfc
component
{
 
private function save(event, rc, prc) {
   rc
.foo = "bar";
   writeDump
(rc);
   
event.noRender();
 
}
}



I could still call it from browser, http://localhost/index.cfm?event=test.save

I thought it could only get called using runEvent(event="test.save", private=true);

What I intended to do is to prevent save() from external call, such as browser, but I can still call it inside my app.


Thanks!

Ancient Programmer

unread,
Apr 14, 2017, 10:37:10 PM4/14/17
to ColdBox Platform
Could someone help me explaining "private event"? From what I understand from https://coldbox.ortusbooks.com/content/full/event_handlers/executing_events.html, a private event cannot be called publicly, but my test code shows different results.

Thank you.

jinglesthula

unread,
Apr 25, 2017, 11:10:59 AM4/25/17
to ColdBox Platform
I'm not 100% sure, but I think there is or was a bug where private functions in handler components were still accessible via URL just like public event functions.  I don't think they're supposed to be.  One of our developers ran into the same thing.  You could see if the latest version of coldbox still has the issue.  I did a quick search (https://ortussolutions.atlassian.net/projects/COLDBOX/issues/COLDBOX-31) but didn't see that this particular issue had been filed as a bug.  It's probably worth writing it up.

Luis Majano

unread,
Apr 25, 2017, 11:16:12 AM4/25/17
to coldbox
I know in early 4 versions this was the case, but it is not anymore.  You can see our test suite on this.

--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org
For Bug Reports, visit https://ortussolutions.atlassian.net/browse/COLDBOX
---
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+unsubscribe@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/coldbox/50a18909-5b1e-4288-83a1-92df0e4edf88%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ancient Programmer

unread,
Apr 26, 2017, 11:22:50 PM4/26/17
to ColdBox Platform
Thanks for all the replies. I will take a look the test suite.


On Sunday, April 2, 2017 at 10:35:43 AM UTC-5, Ancient Programmer wrote:
Reply all
Reply to author
Forward
0 new messages