Not a bug Unable to set options in XenResource_DataWriter_Resource

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:
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...
 
That code creates a new data writer so no options will be preserved.

So I don't really understand the report.
 
Yer, I guess I was looking for it to preserve options in that data writer. I was tired. No bug here...
 
Top Bottom