-
Notifications
You must be signed in to change notification settings - Fork 66
Form type 'phpcr_document' not resolving uuid/identifier to document #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
i think the document type that works with uuid is phpcr_odm_reference_collection - we deprecated it in favor of phpcr_document because they are almost the same. the only difference is that we are missing #103 - if you have experience with the form layer and see how we could fix this, that would be much appreciated. otherwise you could try to use the phpcr_odm_reference_collection type. |
I guess I cannot use |
I've got the following, which is working fine for me, but it does not solve the problem stated above. When I use the parent class PhpcrDocumentType extends AbstractType
{
protected $dm;
/**
* @param DocumentManager $documentManager
*/
public function __construct(DocumentManager $documentManager)
{
$this->dm = $documentManager;
}
public function buildForm(FormBuilderInterface $formBuilder, array $options)
{
$transformer = new DocumentToPathTransformer($this->dm);
$formBuilder->addModelTransformer($transformer);
}
public function getParent()
{
return 'text'; // choice is not working correctly, so I use text as parent
}
/**
* Returns the name of this type.
*
* @return string The name of this type
*/
public function getName()
{
return 'mango_phpcr_document';
}
} |
the phpcr_odm_reference_collection should operate on documents, not on phpcr nodes. but if you have an idea how we can fix phpcr_document to work that way, please do a PR, would love to have it working. |
I do not have very much spare time. But I think I can roll something out this week. |
no worries, asking people if they want to do something is just my way of |
@steffenbrem did you look into this? we are wrapping up for the next release. if you can do a PR this week, it could still make it in. ftr: this is a duplicate of #103 |
closing as duplicate |
Hi,
When I use the form type
phpcr_document
and POST a documents identifier/uuid, it won't resolve correctly. If I use the full path of the node, the data model that comes out of the form is populated correctly. AlsoDocumentToPathTransformer.php
seems not to be used at all, isn't it supposed to use this transformer?This is how I use the form type:
So, when I provide the path of the document it is resolved just fine. But when I want to use the identifier/uuid of the document, it won't resolve it correctly.
Is this a bug or am I using this incorrectly?
Note: I've read that you guys preferred using path over a uuid, but I can't use the path in my system. The uuid is much more convenient. That's why I use the uuid instead of using the documents path as id.
The text was updated successfully, but these errors were encountered: