1

Since CRAFT_AUTOSAVE_DRAFTS=false was deprecated in Craft 4, and actually this method also affect some Craft functionality. i want to know if there another method or event that will run myfunction when i saving draft but not when it was autosaveDraft.

i have tried this code:

Event::on(
        Entry::class,
        Entry::EVENT_AFTER_SAVE,
        function (ModelEvent $event) {
            $entry = $event->sender;

            if (ElementHelper::isDraftOrRevision($entry)){
                # some function
            }

but my function still run when autosaveDraft is triggered(field content change).

Thank :D

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.