Jon W
Well-known member
Because XenForo_Model_DataRegistry is created before code event listeners are enabled, it is impossible to extend XenForo_Model_DataRegistry.
It is called immediately before the listeners are created in XenForo_Dependencies_Abstract:
The first line should be changed to the following:
This ensures that themodel class name is not cached, so any subsequent calls to create XenForo_Model_DataRegistry will check for listeners first.
It is called immediately before the listeners are created in XenForo_Dependencies_Abstract:
PHP:
$data = XenForo_Model::create('XenForo_Model_DataRegistry')->getMulti($required);
if (XenForo_Application::get('config')->enableListeners)
{
if (!is_array($data['codeEventListeners']))
{
$data['codeEventListeners'] = XenForo_Model::create('XenForo_Model_CodeEvent')->rebuildEventListenerCache();
}
XenForo_CodeEvent::setListeners($data['codeEventListeners']);
}
The first line should be changed to the following:
PHP:
$dataRegistryModel = new XenForo_Model_DataRegistry();
$data = $dataRegistryModel->getMulti($required);
This ensures that the
Last edited: