Skip to content

Commit

Permalink
Fix missing 'public: true' needed for symfony 3.3+ (sonata-project#4538
Browse files Browse the repository at this point in the history
  • Loading branch information
mmucklo authored and greg0ire committed Jul 4, 2017
1 parent 10c27f6 commit af8d574
Show file tree
Hide file tree
Showing 15 changed files with 24 additions and 3 deletions.
1 change: 1 addition & 0 deletions Manipulator/ServicesManipulator.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class: %s
arguments: [~, %s, %s]
tags:
- { name: sonata.admin, manager_type: %s, group: admin, label: %s }
public: true
';

/**
Expand Down
1 change: 1 addition & 0 deletions Resources/doc/cookbook/recipe_custom_action.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ or by adding it to your ``admin.yml``:
- null
- AppBundle\Entity\Car
- AppBundle:CRUD
public: true
For more information about service configuration please refer to Step 3 of :doc:`../reference/getting_started`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ To use `SimplePager` in your admin just define ``pager_type`` inside the service
- ~
- AppBundle\Entity\Post
- ~
public: true
.. note::

Expand Down
2 changes: 2 additions & 0 deletions Resources/doc/cookbook/recipe_knp_menu.rst
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ your admin services or simply remove menu items from the ``sonata_admin`` dashbo
arguments: [~, Sonata\AdminBundle\Entity\Post, SonataAdminBundle:CRUD]
tags:
- {name: sonata.admin, manager_type: orm, group: admin, label: Post, show_in_dashboard: false}
public: true
.. code-block:: yaml
Expand Down Expand Up @@ -244,6 +245,7 @@ or in sonata_admin dashboard group configuration:
arguments: [~, Sonata\AdminBundle\Entity\Post, SonataAdminBundle:CRUD]
tags:
- {name: sonata.admin, manager_type: orm, group: admin, label: Post, on_top: true}
public: true
.. code-block:: yaml
Expand Down
1 change: 1 addition & 0 deletions Resources/doc/cookbook/recipe_sortable_listing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ Now you can update your ``services.yml`` to use the handler provider by the ``pi
- ~
- AppBundle\Entity\Client
- 'PixSortableBehaviorBundle:SortableAdmin' # define the new controller via the third argument
public: true
Now we need to define the sort by field to be ``$position``:

Expand Down
1 change: 1 addition & 0 deletions Resources/doc/getting_started/creating_an_admin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ service and tag it with the ``sonata.admin`` tag:
arguments: [~, AppBundle\Entity\Category, ~]
tags:
- { name: sonata.admin, manager_type: orm, label: Category }
public: true
The constructor of the base Admin class has many arguments. SonataAdminBundle
provides a compiler pass which takes care of configuring it correctly for you.
Expand Down
1 change: 1 addition & 0 deletions Resources/doc/getting_started/the_form_view.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ The same applies to the service definition:
arguments: [~, AppBundle\Entity\BlogPost, ~]
tags:
- { name: sonata.admin, manager_type: orm, label: Blog post }
public: true
Configuring the Form Mapper
---------------------------
Expand Down
2 changes: 2 additions & 0 deletions Resources/doc/reference/advanced_configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ You have 2 ways of defining the dependencies inside ``services.xml``:
- ~
- AppBundle\Entity\Project
- ~
public: true
* With a method call, more verbose

Expand Down Expand Up @@ -105,6 +106,7 @@ You have 2 ways of defining the dependencies inside ``services.xml``:
calls:
- [ setLabelTranslatorStrategy, [ "@sonata.admin.label.strategy.native" ]]
- [ setRouteBuilder, [ "@sonata.admin.route.path_info" ]]
public: true
If you want to modify the service that is going to be injected, add the following code to your
application's config file:
Expand Down
2 changes: 2 additions & 0 deletions Resources/doc/reference/architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ your ``Admin`` services. This is done using a ``call`` to the matching ``setter`
- ~
calls:
- [ setLabelTranslatorStrategy, ["@sonata.admin.label.strategy.underscore"]]
public: true
Here, we declare the same ``Admin`` service as in the :doc:`getting_started` chapter, but using a
different label translator strategy, replacing the default one. Notice that
Expand Down Expand Up @@ -147,6 +148,7 @@ to set the controller to ``AppBundle:PostAdmin``:
- AppBundle:PostAdmin
calls:
- [ setTranslationDomain, [AppBundle]]
public: true
When extending ``CRUDController``, remember that the ``Admin`` class already has
a set of automatically injected dependencies that are useful when implementing several
Expand Down
1 change: 1 addition & 0 deletions Resources/doc/reference/dashboard.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ services:
- ~
- AppBundle\Entity\Post
- ~
public: true
In these examples, notice the ``group`` tag, stating that this particular ``Admin``
service belongs to the ``Content`` group.
Expand Down
1 change: 1 addition & 0 deletions Resources/doc/reference/form_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ that looks like this:
- 'SonataAdminBundle:CRUD'
calls:
- [ setTranslationDomain, [AppBundle]]
public: true
.. note::

Expand Down
1 change: 1 addition & 0 deletions Resources/doc/reference/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ Create either a new ``admin.xml`` or ``admin.yml`` file inside the ``src/AppBund
- ~
calls:
- [ setTranslationDomain, [AppBundle]]
public: true
The example above assumes that you're using ``SonataDoctrineORMAdminBundle``.
If you're using ``SonataDoctrineMongoDBAdminBundle``, ``SonataPropelAdminBundle`` or ``SonataDoctrinePhpcrAdminBundle`` instead, set ``manager_type`` option to ``doctrine_mongodb``, ``propel`` or ``doctrine_phpcr`` respectively.
Expand Down
1 change: 1 addition & 0 deletions Resources/doc/reference/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ For example, lets change the Controller for our MediaAdmin class to AppBundle:Me
- ~
- AppBundle\Entity\Page
- 'AppBundle:MediaCRUD' # define the new controller via the third argument
public: true
We now need to create our Controller, the easiest way is to extend the basic Sonata CRUD controller:

Expand Down
1 change: 1 addition & 0 deletions Resources/doc/reference/templates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ specify the templates to use in the ``Admin`` service definition:
- ~
calls:
- [ setTemplate, [edit, AppBundle:PostAdmin:edit.html.twig]]
public: true
.. note::

Expand Down
10 changes: 7 additions & 3 deletions Tests/Manipulator/ServicesManipulatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ public function testAddResource()
class: admin_class
arguments: [~, class, controller_name]
tags:
- { name: sonata.admin, manager_type: manager_type, group: admin, label: class }\n",
- { name: sonata.admin, manager_type: manager_type, group: admin, label: class }
public: true\n",
file_get_contents($this->file)
);
$this->servicesManipulator->addResource(
Expand All @@ -73,12 +74,14 @@ class: admin_class
arguments: [~, class, controller_name]
tags:
- { name: sonata.admin, manager_type: manager_type, group: admin, label: class }
public: true
another_service_id:
class: another_admin_class
arguments: [~, another_class, another_controller_name]
tags:
- { name: sonata.admin, manager_type: another_manager_type, group: admin, label: another_class }\n",
- { name: sonata.admin, manager_type: another_manager_type, group: admin, label: another_class }
public: true\n",
file_get_contents($this->file)
);
}
Expand Down Expand Up @@ -121,7 +124,8 @@ public function testAddResourceWithEmptyServices()
class: admin_class
arguments: [~, class, controller_name]
tags:
- { name: sonata.admin, manager_type: manager_type, group: admin, label: class }\n",
- { name: sonata.admin, manager_type: manager_type, group: admin, label: class }
public: true\n",
file_get_contents($this->file)
);
}
Expand Down

0 comments on commit af8d574

Please sign in to comment.