Jon W
Well-known member
Still trying to get to the bottom of it, but there seems to be an issue with this bit of code in XenForo_DataWriter_Version that causes the options in the resource data-writer to be reset when creating a new resource, meaning it is impossible to change an option when calling the data-writer:
I think the solution is to add a check for $this->isUpdate().
Hope this makes some sort of sense. Let me know if you need more information as it's late now and I need sleep...
PHP:
if ($this->isChanged('version_state'))
{
$resourceDw = XenForo_DataWriter::create('XenResource_DataWriter_Resource', XenForo_DataWriter::ERROR_SILENT);
if ($resourceDw->setExistingData($this->get('resource_id')))
{
$resourceDw->updateCurrentVersion();
$resourceDw->save();
}
$this->_updateDeletionLog();
$this->_updateModerationQueue();
}
I think the solution is to add a check for $this->isUpdate().
Hope this makes some sort of sense. Let me know if you need more information as it's late now and I need sleep...