sonata-project/SonataDoctrinePhpcrAdminBundle — pull request #317 by lsmith77 (2014-12-13 13:04:11+00:00)
Title: added support for sonata_type_model_autocomplete for type

```
diff --git a/app/config/routing.yml b/app/config/routing.yml
index 7e6fd9c..220f427 100644
--- a/app/config/routing.yml
+++ b/app/config/routing.yml
@@ -76,3 +76,7 @@ cmf_media_image:

elfinder:
resource: "@FMElfinderBundle/Resources/config/routing.yml"
+
+sonata_autocomplete_title:
+ pattern: /autocomplete_title
+ defaults: { _controller: sonata.admin.doctrine_phpcr.autocomplete_controller:autoCompleteAction, _method_name: getTitle }
\ No newline at end of file
```

```
diff --git a/Admin/StaticContentAdmin.php b/Admin/StaticContentAdmin.php
index e4638ad..f83bbf3 100644
--- a/Admin/StaticContentAdmin.php
+++ b/Admin/StaticContentAdmin.php
@@ -39,7 +39,7 @@ class StaticContentAdmin extends Admin
{
$formMapper
->with('form.group_general')
- ->add('parent', 'doctrine_phpcr_odm_tree', array('root_node' => $this->getRootPath(), 'choice_list' => array(), 'select_root_node' => true))
+ ->add('parent', 'sonata_type_model_autocomplete', array('model_manager' => $this->getModelManager(), 'property' => 'title', 'route' => array('name' => 'sonata_autocomplete_title')))
->add('name', 'text')
->add('title', 'text')
->add('body', 'textarea')
```

but there is a problem, since data is submitted as:
```
parent => [
title => cms/content/home,
identifiers => [
0 => cms/content/home
]
],
```

rather than:

```
parent => cms/content/home,