Closed JDGrimes closed 8 years ago
Our network mode handling is much improved in the new hooks API (#321). I'm not entirely sure that we should consider this fixed though, because as we said, it's almost a bug. However, I don't think that we're going to pursue this here, since all of this code is soon to be deprecated anyway. If we want we can revisit this later.
The network mode for the points hooks works fine for the user in normal operation. However, we run into issues when we're trying to do things programmatically, for example in the unit tests.
The main sore points:
get_instances()
doesn't have an option that automatically detect the current network mode status and return the hooks accordingly.get_instances()
aren't identifiable as for network hooks when getting just the'network'
hooks.The result of no. 2 is that you have to be very careful with what you do with a hook ID number. For example, consider this code:
It looks like it should work perfectly. We've even gone so far as to explicitly turn on network mode. However, this will actually be getting the points types of regular hooks. You have to append
network_
to the hook ID number in order to get points types of the network hooks.This is almost a bug.