You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In FilterComponent::beforeRender, when there's a selector specified, you check to see if a model has the specified method...
if (!method_exists($workingModel, $settings['selector']))
{
// trigger the error
... and if it doesn't, you trigger an error.
This doesn't take into account if the model has access to the selector method through a behavior, either explicitly declared in the behavior or through a magic "mapMethod." Adding a check against the model's BehaviorCollection->hasMethod resolves this problem.
if (
! method_exists($workingModel, $settings['selector']) &&
! $workingModel->Behaviors->hasMethod($settings['selector'])
)
{
// now you can trigger that error
The text was updated successfully, but these errors were encountered:
In FilterComponent::beforeRender, when there's a
selector
specified, you check to see if a model has the specified method...... and if it doesn't, you trigger an error.
This doesn't take into account if the model has access to the
selector
method through a behavior, either explicitly declared in the behavior or through a magic "mapMethod." Adding a check against the model's BehaviorCollection->hasMethod resolves this problem.The text was updated successfully, but these errors were encountered: