Jeremy
in memoriam 1991-2020
OK, so Cezz and I have spent literally the last 4 hours working on this problem. For one of her add-ons, she wanted to perform an action on a thread after it was posted. Obviously, we added event listeners for the load_class_datawriter event, and looked for the class of XenForo_DataWriter_Discussion_Thread, and added her class in $extend[]. She over wrote Save so she could do whatever, then call parent::save(). However, the problem lies in the fact that her code never run. It took me a while (way to long) to realize that posting a thread is handled by XenForo_ControllerPublic_Forum, so once we got that... I delved into the code to find out how it created the thread... low and behold, it called XenForo_DataWriter_Discussion_Thread.
So, my question (and bug report?) is why was it never extended? I added several var_dump() and print statements into the code so that I could see what was being called... It seems that the XenForo_CodeEvent::fire() was never called for load_class_datawriter as it never showed up in my dumps.
Cezz could probably really use the datawriter class, as she needs to access at least the thread ID, but I got her on her way working and overwriting actionAddThread(). Bug? Freak Coding problem?
So, my question (and bug report?) is why was it never extended? I added several var_dump() and print statements into the code so that I could see what was being called... It seems that the XenForo_CodeEvent::fire() was never called for load_class_datawriter as it never showed up in my dumps.
Cezz could probably really use the datawriter class, as she needs to access at least the thread ID, but I got her on her way working and overwriting actionAddThread(). Bug? Freak Coding problem?