-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Keep only common option in FieldDescriptionOptions type #7103
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,33 +32,29 @@ | |
| * Some options are global across the different contexts, other are | ||
| * context specifics. | ||
| * | ||
| * Global options : | ||
| * Global options: | ||
| * - type (m): define the field type (use to tweak the form or the list) | ||
| * - template (o) : the template used to render the field | ||
| * - name (o) : the name used (label in the form, title in the list) | ||
| * - link_parameters (o) : add link parameter to the related Admin class when | ||
| * - template (o): the template used to render the field | ||
| * - label (o): the name used (label in the form, title in the list) | ||
| * - accessor (o): the method or the property path to retrieve the related value | ||
| * - associated_property (o): the method or the property path to retrieve the "string" | ||
| * representation of the collection element. | ||
| * - link_parameters (o): add link parameter to the related Admin class when | ||
| * the Admin.generateUrl is called | ||
| * - accessor : the method or the property path to retrieve the related value | ||
| * - associated_tostring : (deprecated, use associated_property option) | ||
| * the method to retrieve the "string" representation | ||
| * of the collection element. | ||
| * - associated_property : property path to retrieve the "string" representation | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| * of the collection element. | ||
| * | ||
| * Form Field options : | ||
| * Form Field options: | ||
| * - field_type (o): the widget class to use to render the field | ||
| * - field_options (o): the options to give to the widget | ||
| * - edit (o) : list|inline|standard (only used for associated admin) | ||
| * - list : open a popup where the user can search, filter and click on one field | ||
| * - edit (o): list|inline|standard (only used for associated admin) | ||
| * - list: open a popup where the user can search, filter and click on one field | ||
| * to select one item | ||
| * - inline : the associated form admin is embedded into the current form | ||
| * - standard : the associated admin is created through a popup | ||
| * - inline: the associated form admin is embedded into the current form | ||
| * - standard: the associated admin is created through a popup | ||
| * | ||
| * List Field options : | ||
| * List Field options: | ||
| * - identifier (o): if set to true a link appear on to edit the element | ||
| * | ||
| * Filter Field options : | ||
| * - options (o): options given to the Filter object | ||
| * Filter Field options: | ||
| * - field_type (o): the widget class to use to render the field | ||
| * - field_options (o): the options to give to the widget | ||
| * | ||
|
|
@@ -269,11 +265,12 @@ public function setOptions(array $options) | |
| unset($options['help']); | ||
| } | ||
|
|
||
| // set default placeholder | ||
| // NEXT_MAJOR: Remove this. | ||
| if (!isset($options['placeholder'])) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if not set, it will set a default, but if it is set to null, it won't, I think the new behavior you implemented don't cover this case
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isset(null) is false. So |
||
| $options['placeholder'] = 'short_object_description_placeholder'; | ||
| } | ||
|
|
||
| // NEXT_MAJOR: Remove this. | ||
| if (!isset($options['link_parameters'])) { | ||
| $options['link_parameters'] = []; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,11 +24,11 @@ file that was distributed with this source code. | |
| 'code': sonata_admin.field_description.associationadmin.code, | ||
| 'objectId': sonata_admin.field_description.associationadmin.id(sonata_admin.value), | ||
| 'uniqid': sonata_admin.field_description.associationadmin.uniqid, | ||
| 'linkParameters': sonata_admin.field_description.option('link_parameters') | ||
| 'linkParameters': sonata_admin.field_description.option('link_parameters', {}) | ||
| })) }} | ||
| {% elseif sonata_admin.field_description.option('placeholder') %} | ||
| {% elseif sonata_admin.field_description.option('placeholder', 'short_object_description_placeholder') %} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this can't be correct, otherwise it is an always true if and can be removed with just else
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To disabled the placeholder, 'false' should be use. |
||
| <span class="inner-field-short-description"> | ||
| {{ sonata_admin.field_description.option('placeholder')|trans({}, 'SonataAdminBundle') }} | ||
| {{ sonata_admin.field_description.option('placeholder', 'short_object_description_placeholder')|trans({}, 'SonataAdminBundle') }} | ||
| </span> | ||
| {% endif %} | ||
| </span> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,11 +24,11 @@ file that was distributed with this source code. | |
| 'code': sonata_admin.field_description.associationadmin.code, | ||
| 'objectId': sonata_admin.field_description.associationadmin.urlSafeIdentifier(sonata_admin.value), | ||
| 'uniqid': sonata_admin.field_description.associationadmin.uniqid, | ||
| 'linkParameters': sonata_admin.field_description.option('link_parameters') | ||
| 'linkParameters': sonata_admin.field_description.option('link_parameters', {})) | ||
| })) }} | ||
| {% elseif sonata_admin.field_description.option('placeholder') %} | ||
| {% elseif sonata_admin.field_description.option('placeholder', 'short_object_description_placeholder') %} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
| <span class="inner-field-short-description"> | ||
| {{ sonata_admin.field_description.option('placeholder')|trans({}, 'SonataAdminBundle') }} | ||
| {{ sonata_admin.field_description.option('placeholder', 'short_object_description_placeholder')|trans({}, 'SonataAdminBundle') }} | ||
| </span> | ||
| {% endif %} | ||
| </span> | ||
|
|
||
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.
Apparently
link_parametersit us used in the route generator, so I guess is kind of global:SonataAdminBundle/src/Route/DefaultRouteGenerator.php
Line 98 in 137ffd9