0

I have a very simple Channel Form on my page :

    {exp:channel:entries channel="accueil" limit="1"}
    {exp:channel:form channel="accueil" entry_id="{entry_id}" require_entry="yes" return="accueil/index" error_handling="inline" show_fields="titre_de_laccueil|texte_de_laccueil|domaines_dexpertise"}
        {custom_fields}
            <p>
            <label for="{field_name}">{field_label}{if required}<span class="required_field_asterisk"> *</span>{/if}</label>
            {field_instructions}
            {formatting_buttons}

            {if error}
                <p class="error">{error}</p>
            {/if}

            {if textarea}
                <textarea id="{field_name}" name="{field_name}" dir="{text_direction}" rows="{rows}">{field_data}</textarea>
            {/if}

            {if text}
                <input type="text" dir="{text_direction}" id="{field_name}" name="{field_name}" value="{field_data}" maxlength="{maxlength}" size="50">
            {/if}

            {if select}
                <select id="{field_name}" name="{field_name}">
                  {options}<option value="{option_value}"{selected}>{option_name}</option>{/options}
                </select>
            {/if}

            {if checkbox}
                {options}
                  <label class="checkbox">{option_value}
                    <input type="checkbox" id="{field_name}" name="{field_name}[]" value="{option_value}"{checked}>
                  </label>
                {/options}
            {/if}

            {if grid}
                {display_field}
            {/if}

            {if wygwam}
                {display_field}
            {/if}

            {if field_name=='domaines'}
                {display_field}
            {/if}

            </p>
        {/custom_fields}

  <input type="submit" value="Enregistrer les modifications">
{/exp:channel:form}

{/exp:channel:entries}

If I just change the contents of the fields and click on submit --> no problem, it saves the modified entry as intended.

If I empty a required field and click on submit --> I get this error (that prevent the modified entry to be saved) instead of the validation :

A PHP Error was encountered

Severity: Notice

Message: Undefined property: EE::$view

Filename: libraries/File_field.php

Line Number: 718

Fatal error: Call to a member function head_link() on a non-object in [...]/system/expressionengine/libraries/File_field.php on line 718

I don't even have a file field in this channel!

I didn't find the reason of this...

EE version : 2.11.1

1
  • Some new investigations showed me that if I remove the {if wygwam} {display_field} {/if} (I have a wygwam field in my channel) and empty a required field as explained above, it gives me the right validation message "This field is required" in place of throwing the PHP error...Perhaps this is a clue
    – pikarge
    Jun 6, 2016 at 9:24

1 Answer 1

0

Try not wrapping the channel:form in a channel:entries tag. You shouldn't have to.

1
  • I tried but unfortunately it doesn't change anything...
    – pikarge
    Jun 6, 2016 at 8:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.