AnsweredAssumed Answered

Logic hook not called when saving bean in API call

Question asked by Edouard DEBOVE on Apr 15, 2016

Hello all,

 

I've been wondering about this for quite a long time already, hopefully someone can help. Here is the situation:

 

I make an API call (POST) in which I save a bean using $my_variable->save(). When I do so, my before_save logic hooks  does not run and I'm quite sure that the before_save_method is not called.

- it is not about the API call itself that works like a charm if I comment the line $my_variable->save().

- it is not a spelling mistake in the path or a permission problem because I tested it with full permissions and I can see in the logs the couple of messages I put in the logic_hooks_class.php (at the very beginning of the file and after the entry_point check). However the fatal message I put in the first line of the before_save_method doesn't show up in the logs.

- it is not a misspelling in the name of the before_save_method or about the content of the method itself because it works fine if a record is saved from sugar interface directly. I also tried to comment all the content of the method and the problem still occurs.

 

If anyone has a clue or faced the same problem please let me know.

 

Ed

Outcomes