neokoenig / cfwheels-shortcodes

A Shortcodes plugin for cfwheels
MIT License
5 stars 2 forks source link

The method $sc_REReplaceCallback is part of a plugin but was not found in the base object #3

Open basshcm opened 5 years ago

basshcm commented 5 years ago

neokoenig, I was trying to use the shortcodes plugin with cfwheels 2.0.

I am receiving the following error....

Wheels.MethodNotFound
The method $sc_REReplaceCallback is part of a plugin but was not found in the base object.

Tag context
Error thrown on line 152 in plugins\Shortcodes\Shortcodes.cfc
- called from line 77 in wheels\plugins\runners.cfm
- called from line 28 in plugins\Shortcodes\Shortcodes.cfc
- called from line 77 in wheels\plugins\runners.cfm
- called from line 7 in /wheels../views/login/index.cfm
- called from line 117 in wheels\global\cfml.cfm
- called from line 474 in wheels\controller\rendering.cfm
- called from line 225 in wheels\controller\rendering.cfm
- called from line 66 in wheels\controller\rendering.cfm
- called from line 134 in wheels\controller\processing.cfm
- called from line 91 in wheels\controller\processing.cfm
- called from line 184 in wheels\dispatch\functions.cfm
- called from line 5 in wheels\index.cfm
- called from line 2 in rewrite.cfm
- called from line 5 in wheels\events\onrequest.cfm

However it works when replacing line 28 result=$sc_REReplaceCallback(string=content, pattern=$sc_getRegex(), callback=$sc_processTag, scope="all"); with result=$sc_REReplaceCallback(string=content, pattern=$sc_getRegex(), scope="all");

AND line 152
replace = callback(parts); with replace = $sc_processTag(parts);

I am confused why the callback function is not being recognized? I appreciate any help/direction you could give me.

neokoenig commented 5 years ago

I believe this is related to https://github.com/cfwheels/cfwheels/issues/841 which is on our bug fix list for 2.1 - or at least, I think this is contributing to it: I think the function name callback is clashing with existing methods in the scope.

basshcm commented 5 years ago

Thanks neokoenig. like I mentioned, I have a workaround for now. I will watch for the cfwheels 2.1 update.