I have an entry form (in a local v3.5.13.1 dev context) configured to update existing entries in a particular section. On load, it’s reflecting existing data (input via the Craft control panel) perfectly well, including Assets and Matrix field content.
But when I'm logged in as a Super Admin and I submit changes, it will receive updates to the entry Title
field but not to any custom fields.
No errors are being reported and it redirects to the desired page.
At present, I have stripped it right back to the Title
field and a single Plain Text custom field but no joy. Here is my form code:
{% set entry = entry ?? create('craft\\elements\\Entry') %}
{% set redirectUrl = "partners/#{entry.id}" %}
{% set sectionId = entry.sectionId %}
<form method="post" accept-charset="UTF-8">
{{ csrfInput() }}
{{ actionInput('entries/save-entry') }}
{{ redirectInput(redirectUrl) }}
{{ hiddenInput('sectionId', '5') }}
{{ hiddenInput('enabled', '1') }}
{{ hiddenInput('entryId', entry.id) }}
{{ hiddenInput('entryVariable', 'badEntry'|hash) }}
{% macro errorList(errors) %}
{% if errors %}
<ul class="errors">
{% for error in errors %}
<li>{{ error }}</li>
{% endfor %}
</ul>
{% endif %}
{% endmacro %}
<p>
<label class="field-below">
<span class="field-label"><strong>Organisation name</strong></span>
{{ input('text', 'title', entry.title, {
required: true,
class: entry.hasErrors('title') ? 'text error' : 'text'
}) }}
{{ _self.errorList(entry.getErrors('title')) }}
</label>
</p>
<p>
<label class="field-below">
<span class="field-label">
<strong>Headline:</strong>
<span class="line-ib">Optional, 10 words or fewer recommended</span>
</span>
{{ input('text', 'headline', entry.headline, {
required: true,
class: entry.hasErrors('headline') ? 'text error' : 'text'
}) }}
{{ _self.errorList(entry.getErrors('headline')) }}
</label>
</p>
<p class="field-submit">
<input type="submit" class="btn" value="Update page">
</p>
</form>
No updates to the Headline
field get saved. Updates to the Title
field do. Where can I be going wrong?