-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Deprecate exporter class and service #4029
Deprecate exporter class and service #4029
Conversation
1d2a922
to
1d06d9b
Compare
Shit, I can't deprecate services in old versions of symfony… |
c903a46
to
b51fb4b
Compare
Fixed. Please review @sonata-project/contributors |
53feda0
to
b51fb4b
Compare
Hmmm… there is another problem : |
b51fb4b
to
b56a426
Compare
|
I know, but I realized that I took it into account when POSTing, but must also make sure the format list in the combo box is updated too. |
Bridge/Exporter/AdminExporter.php
Outdated
use Exporter\Exporter; | ||
use Sonata\AdminBundle\Admin\AdminInterface; | ||
|
||
final class AdminExporter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sonata-project/contributors : if you have a better name for this service I'm all ears. I extracted this from CrudController::exportAction
so that it can be easily unit tested.
206bf9d
to
f98932b
Compare
Admin/AbstractAdmin.php
Outdated
@@ -66,6 +66,7 @@ | |||
)\\\(.*)@x'; | |||
|
|||
const MOSAIC_ICON_CLASS = 'fa fa-th-large fa-fw'; | |||
const DEFAULT_EXPORT_FORMATS = array('json', 'xml', 'csv', 'xls'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? We can't override this constant and we only use it once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Three times you mean. On the getter, in the new service, and in the test for the new service
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just read the diff...
You extracted a new constant which is only used once. So why did we need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed it, it is actually used 3 times now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay then 👍
f98932b
to
96b340a
Compare
96b340a
to
1245bda
Compare
3f378a1
to
a1dad64
Compare
8261504
to
76b8c56
Compare
Could you please rebase your PR and fix merge conflicts? |
Please rebase, so we can merge this @greg0ire |
The class was already marked as deprecated, but only in its phpdoc. Let's schedule its deletion.
76b8c56
to
f6ab219
Compare
f6ab219
to
dd37721
Compare
@core23 done |
@sonata-project/contributors please merge |
@@ -176,16 +176,19 @@ file that was distributed with this source code. | |||
</div> | |||
|
|||
|
|||
{# NEXT_MAJOR : remove this assignment #} | |||
{% set export_formats = export_formats|default(admin.getExportFormats) %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to make sure, admin.getExportFormats
will work the same as admin.getExportFormats()
?
AFAIK you can do something like admin.exportFormats
at twig will pick the getter.
If this works also, lets merge this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works also, but I can change it to your solution, which is more graceful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your decision, tell me when you want me to merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please merge when the build is green.
dd37721
to
9b0829d
Compare
Thanks @greg0ire !! |
Finally! Thanks everyone! |
@greg0ire it would be great if you could remove the deprecated code afterwards on master |
@OskarStark will do! |
@@ -65,6 +65,12 @@ All files under the ``Tests`` directory are now correctly handled as internal te | |||
You can't extend them anymore, because they are only loaded when running internal tests. | |||
More information can be found in the [composer docs](https://getcomposer.org/doc/04-schema.md#autoload-dev). | |||
|
|||
### Exporter service and class |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again on the wrong place. Please be careful.
A check bot is very necessary for this IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Argh! Sorry…
I am targetting this branch, because this is BC
Closes #3124 , #1550 (I think)
Changelog
To do
deprecated
tag is not supported)CrudController::exportAction()
to use a dedicated, unit-tested service when availablesonata.admin.admin_exporter
service when the exporter bundle is registeredgetAvailableFormats()
to display the formats listSubject
This deprecates the export class and service