Announcement

Collapse
No announcement yet.

beforeSave in custom Hook does not trigger when quick edit is used

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • beforeSave in custom Hook does not trigger when quick edit is used

    Hi,

    I just noticed that a beforeSave function in my custom Hook does not trigger when the edit in done in quick mode (single field modificaition). It works fine when then change is done une full edit mode.

    I've been coding Hooks for quite a few time now and I believe this did not happen in earlier versions. Here I am using Version 5.7.11

    I've done some tests by logging some debug texts in different use cases to come to the conclusions above.

    Logging in the init function of the Hook always happens but not in beforeSave function.

    Could you please help me with this, it does seem to be a correct behavior to me.

    Thanks in advance

  • #2
    Hi,

    When you save in inline edit, it makes the same API call as when you use the regular edit.

    Comment


    • huscmk
      huscmk commented
      Editing a comment
      Hi,
      Thanks for your reply.

      Yes this is what I noticed until now. I never had a different behavior between regular and inline edit in terms of Hook triggering before.

      However I do have it now but I can't figure out why.

      Here is my test :

      I create a custom Hook for an Entity.
      I override the init function and put a logging code in it to see if the Hook is called.
      I do the same thing for the beforeSave function.

      On the front, I try making a modification in regular mode on a existing record. I have the logging from init and beforeSave in my log file.

      If I try modifying the same field in inline edit, I see only the init logging in my log file. Meaning that the Hook is called, but not the beforeSave function.

      Any idea where I could look to solve that issue?

      Thanks in advance
Working...
X