You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.
This works when fetching a document from the database, but it fails when trying to persist a new document to the database.
The problem is in Doctrine\ODM\CouchDB\UnitOfWork::flush() where the field values are converted to JSON values. The _rev version field is included in the JSON, even if it is null. This results in a 400 bad request response from CouchDB.
Our workaround is to replace line 1072 with the following code snippet:
Rather than testing the JSON name, it might be more consistent with the rest of your design to test $class->fieldMappings[$fieldName]['isVersionField'] or to check whether $fieldName is equal to $class->versionField.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
We tried mapping the CouchDB _rev string to a PHP property. The line we used in the XML mapping file was:
This works when fetching a document from the database, but it fails when trying to persist a new document to the database.
The problem is in
Doctrine\ODM\CouchDB\UnitOfWork::flush()
where the field values are converted to JSON values. The _rev version field is included in the JSON, even if it is null. This results in a 400 bad request response from CouchDB.Our workaround is to replace line 1072 with the following code snippet:
Rather than testing the JSON name, it might be more consistent with the rest of your design to test
$class->fieldMappings[$fieldName]['isVersionField']
or to check whether$fieldName
is equal to$class->versionField
.The text was updated successfully, but these errors were encountered: