Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension hooks get called twice #81

Open
sanderha opened this issue Aug 15, 2017 · 1 comment
Open

Extension hooks get called twice #81

sanderha opened this issue Aug 15, 2017 · 1 comment

Comments

@sanderha
Copy link

It seems the various hooks in classes such as RESTfulAPI_DefaultQueryHandler get called twice.

If I define onAfterDeserialize() on a DataExtension, this method gets called twice in RESTfulAPI_DefaultQueryHandler::updateModel(), by this code:

        // After deserialize hook
        if (method_exists($model, 'onAfterDeserialize')) {
            $model->onAfterDeserialize($payload);
        }
        $model->extend('onAfterDeserialize', $payload);

It seems method_exists returns true in this case for some reason. Im running this on SilverStripe 3.5

@colymba
Copy link
Owner

colymba commented Aug 17, 2017

umm... probably should just keep the extend call and get rid of the other one.
Care to send a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants