Skip to content

Commit c29fc6d

Browse files
committed
Version 5.0.4
Bugfix & styling adjustments
1 parent 82e1675 commit c29fc6d

File tree

2 files changed

+26
-9
lines changed

2 files changed

+26
-9
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Release Notes for chatgpt-integration
22

3+
## 5.0.4 - 2025-03-26
4+
5+
### Fixed
6+
- Bug "```Calling unknown method: craft\fields\Matrix::getBlockTypes()```" in the field settings (Issue #7)
7+
- Minor styling adjustments on the fields-setting page
8+
39
## 5.0.3 - 2024-04-29
410

511
### Fixed

src/templates/settings/fields.twig

+20-9
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,14 @@
2020
{% for entryType in entryTypes %}
2121
{% if entryType.fieldlayout.customFields|length %}
2222
<h3 class="table-heading">{{ entryType.name }} (
23-
<div class="fields-handle-attribute code small light copytextbtn" title="Copy to clipboard" role="button" aria-label="Copy to clipboard" tabindex="0" onclick="navigator.clipboard.writeText('{{ entryType.handle }}')">
23+
<div class="fields-handle-attribute code small light copytextbtn"
24+
title="Copy to clipboard"
25+
role="button"
26+
aria-label="Copy to clipboard"
27+
tabindex="0"
28+
onclick="navigator.clipboard.writeText('{{ entryType.handle }}')"
29+
style="display: inline;"
30+
>
2431
<input type="text" value="{{ entryType.handle }}" readonly="" size="{{ entryType.handle|length }}" tabindex="-1">
2532
<span data-icon="clipboard" aria-hidden="true"></span>
2633
</div>
@@ -36,16 +43,17 @@
3643
<th class="thin">{{ 'Enabled' |t('chatgpt-integration') }}</th>
3744
</tr>
3845
</thead>
46+
<tbody>
47+
3948
{% for field in entryType.fieldlayout.customFields %}
40-
<tbody>
4149
<tr class="s-{{ field.id }}">
4250
<td class="label-column">{{ field.name }}</td>
4351
<td class="handle-column">
4452
<div class="fields-handle-attribute code small light copytextbtn" title="Copy to clipboard" role="button" aria-label="Copy to clipboard" tabindex="0" onclick="navigator.clipboard.writeText('{{ field.handle }}')">
4553
<input type="text" value="{{ field.handle }}" readonly="" size="{{ field.handle|length }}" tabindex="-1">
4654
<span data-icon="clipboard" aria-hidden="true"></span>
4755
</div></td>
48-
<td class="group-column">{{ craft.chatgptIntegration.getClass(field) }}</td>
56+
<td class="field-type-column">{{ craft.chatgptIntegration.getClass(field) }}</td>
4957
<td class="enabled-column">
5058
{% if craft.chatgptIntegration.getClass(field) != "craft\\fields\\Matrix" %}
5159
{{ forms.lightswitch({
@@ -55,40 +63,43 @@
5563
{% endif %}
5664
</td>
5765
</tr>
58-
</tbody>
5966

6067
{% if craft.chatgptIntegration.getClass(field) == "craft\\fields\\Matrix" %}
61-
{% for block in field.getBlockTypes() %}
68+
{% for block in field.getEntryTypes() %}
6269
{% for matrixField in block.customFields %}
63-
<tbody>
6470
<tr class="s-{{ matrixField.id }}">
6571
<td class="label-column" style="text-indent: 2em;">{{ block.name }}: {{ matrixField.name }}</td>
6672
<td class="handle-column">
6773
<div class="fields-handle-attribute code small light copytextbtn" title="Copy to clipboard" role="button" aria-label="Copy to clipboard" tabindex="0" onclick="navigator.clipboard.writeText('{{ matrixField.handle }}')">
6874
<input type="text" value="{{ matrixField.handle }}" readonly="" size="{{ matrixField.handle|length }}" tabindex="-1">
6975
<span data-icon="clipboard" aria-hidden="true"></span>
7076
</div></td>
71-
<td class="group-column">{{ craft.chatgptIntegration.getClass(matrixField) }}</td>
72-
<td class="group-column">{{ matrixField.group ?? field.group }}</td>
77+
<td class="field-type-column">{{ craft.chatgptIntegration.getClass(matrixField) }}</td>
7378
<td class="enabled-column">
7479
{{ forms.lightswitch({
7580
name: 'enabledFields[' ~ entryType.handle ~ '_' ~field.handle~'].key',
7681
on: settings.enabledFields|length and settings.enabledFields[entryType.handle ~ '_' ~field.handle] is defined and settings.enabledFields[ entryType.handle ~ '_' ~field.handle]
7782
}) }}
7883
</td>
7984
</tr>
80-
</tbody>
8185
{% endfor %}
8286
{% endfor %}
8387
{% endif %}
8488
{% endfor %}
89+
</tbody>
90+
8591
</table>
8692
</div>
8793
{% else %}
8894
<div>
8995
<p>{{ 'No fields exist yet.'|t('chatgpt-integration') }}</p>
9096
</div>
9197
{% endif %}
98+
99+
{% else %}
100+
<div>
101+
<p>{{ 'No fields exist yet.'|t('chatgpt-integration') }}</p>
102+
</div>
92103
{% endfor %}
93104

94105
{% endnamespace %}

0 commit comments

Comments
 (0)