Skip to content

Commit f182bb1

Browse files
Merge pull request #17554 from pokemaobr/REMOVING_GET_DISPLAY_FIELD_FUNCTION_ON_TWIG
Removing get display field function on twig template
2 parents 649d9b3 + 228fde0 commit f182bb1

3 files changed

Lines changed: 2 additions & 7 deletions

File tree

‎libraries/classes/Controllers/Table/RelationController.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ public function __invoke(): void
167167
'dbi' => $this->dbi,
168168
'default_sliders_state' => $GLOBALS['cfg']['InitialSlidersState'],
169169
'route' => $route,
170+
'display_field' => $this->relation->getDisplayField($GLOBALS['db'], $GLOBALS['table']),
170171
]);
171172
}
172173

‎libraries/classes/Twig/RelationExtension.php‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ public function getFunctions()
2020
$relation = new Relation($GLOBALS['dbi']);
2121

2222
return [
23-
new TwigFunction(
24-
'get_display_field',
25-
[$relation, 'getDisplayField'],
26-
['is_safe' => ['html']]
27-
),
2823
new TwigFunction(
2924
'get_foreign_data',
3025
[$relation, 'getForeignData']

‎templates/table/relation/common_form.twig‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,14 +203,13 @@
203203
{% endif %}
204204

205205
{% if relation_parameters.displayFeature is not null %}
206-
{% set disp = get_display_field(db, table) %}
207206
<fieldset class="pma-fieldset">
208207
<label>{% trans 'Choose column to display:' %}</label>
209208
<select name="display_field">
210209
<option value="">---</option>
211210
{% for row in save_row %}
212211
<option value="{{ row['Field'] }}"
213-
{%- if disp is defined and row['Field'] == disp %}
212+
{%- if display_field is defined and row['Field'] == display_field %}
214213
selected="selected"
215214
{%- endif %}>
216215
{{ row['Field'] }}

0 commit comments

Comments
 (0)