"hook" parameter doesn't work in PodioItem::update API.
I hooked "item.update" event, the hook code would update the item to original version. I use ['hook'=>false] in PodioItem::update, but I found that my code is called over and over again and in item activity history there are lots of change logs.
This problem is very similar to my another question, I posted here https://help.podio.com/hc/communities/public/questions/200924647-serious-problem-PodioComment-Create-doesn-t-support-hook-false-parameter-
that problem was solved after podio update its server side.
I hope this problem be solved as soon as possible, thanks.
-
The problem is not solved. Some time ago, I made a syntax to my hook code to force stop the loop update process. After that I change my code to the old array syntax, I saw there is no loop update process, so I thought the problem is solved. In fact my code is not invoke because of syntax error.
After I remove the syntax error, the loop update process emerge again, you can see this in item 147190402. -
In Podio Tutorials - Working with Webhooks -> Avoiding infinite loops
It says:
"Often you want to update the item that caused the hook to fire. For example immediately update a field value when some other field value changes. That can cause infinite loops where your update causes yet another hook to fire.
To avoid this situation the add new item, update item and delete item operations all support a hook query parameter you can use to prevent hooks from firing as you manipulate items using these operations."
Since podio said "update item" can handle with the "hook" query parameter, I don't know if my code is wrong, this is my code:
PodioItem::update($manager_item_id,array('fields'=>$emp_item_fields),array('hook'=>false));
Is there something wrong with my code?
Please sign in to leave a comment.
Comments
4 comments