Merge pull request #17554 from pokemaobr/REMOVING_GET_DISPLAY_FIELD_FUNCTION_ON_TWIG

Removing get display field function on twig template
This commit is contained in:
Maurício Meneghini Fauth 2022-05-24 14:40:44 -03:00 committed by GitHub
commit f182bb1131
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 7 deletions

View File

@ -167,6 +167,7 @@ final class RelationController extends AbstractController
'dbi' => $this->dbi,
'default_sliders_state' => $GLOBALS['cfg']['InitialSlidersState'],
'route' => $route,
'display_field' => $this->relation->getDisplayField($GLOBALS['db'], $GLOBALS['table']),
]);
}

View File

@ -20,11 +20,6 @@ class RelationExtension extends AbstractExtension
$relation = new Relation($GLOBALS['dbi']);
return [
new TwigFunction(
'get_display_field',
[$relation, 'getDisplayField'],
['is_safe' => ['html']]
),
new TwigFunction(
'get_foreign_data',
[$relation, 'getForeignData']

View File

@ -203,14 +203,13 @@
{% endif %}
{% if relation_parameters.displayFeature is not null %}
{% set disp = get_display_field(db, table) %}
<fieldset class="pma-fieldset">
<label>{% trans 'Choose column to display:' %}</label>
<select name="display_field">
<option value="">---</option>
{% for row in save_row %}
<option value="{{ row['Field'] }}"
{%- if disp is defined and row['Field'] == disp %}
{%- if display_field is defined and row['Field'] == display_field %}
selected="selected"
{%- endif %}>
{{ row['Field'] }}