0

Making first steps with Craft CMS, and it's great, but there is one thing i can't figure out:

When trying to add a new entry with a rather complex set of fields (including matrix) there is an error:

Failed to load Twig template "_includes/field", index "764771142": cache is corrupted.

in E:\craft\playground\vendor\craftcms\cms\src\templates_includes\field.html line 17:

{% if instructions or input %}
    {% embed "_includes/forms/field" with {
        label: field.name|t('site')|e,
        translatable: translatable,
        siteId: siteId,
        required: (not static ? required : false),

Editing existing entries works fine.

Running 3.0.4

Clear Cache Tool has run, and i also delete the cache files in /storage. No custom field types.

Thanks for ideas.

  • Additional info: This error occurs only when devMode=true – Susi Hofman Apr 28 '18 at 17:19
  • Restricting image upload to a single folder {owner.filmtitle|kebab} possibly caused the error, replacing the folder template helped: {% if owner.filmtitle %}{owner.filmtitle|kebab}{%else%}default{%endif%} – Susi Hofman Apr 29 '18 at 11:15
  • Glad you got it sorted, Susi. Would you mind adding that as an official answer in case it ends up helping someone in the future? – Brad Bell May 1 '18 at 0:05
0

Additional info: This error occurs only when devMode=true

Restricting image upload to a single folder {owner.filmtitle|kebab} possibly caused the error, replacing the folder template helped:

{% if owner.filmtitle %}{owner.filmtitle|kebab}{%else%}default{%endif%}

Nevertheless i don't understand why the former version caused the error, and the error message is very misleading.

|improve this answer|||||
  • Because every volume has a different layout and you'll receive an exception if the layout does not include a field with the handle filmtitle. Disabling dev mode prevents exceptions at all. That's Why you won't notice them – Robin Schambach May 2 '18 at 12:39
  • @RobinSchambach, thanks, but filmtitle is always there and mandatory. I think the kebab filter causes the error when applied at this point. I tried that in combination with the ''convertFilenamesToAscii' => true config to create valid folder names. But maybe theres a better solution for that? – Susi Hofman May 3 '18 at 8:31
  • Addition : We didn't want to use the slug, because that looks different for some crazy SEO reasons. – Susi Hofman May 3 '18 at 8:40
  • I'm getting the same problem on the backend. The issue seems to be using dynamic parameters within the directory path. For instance I want all my product images to go into products/{slug}. Without {slug} in the path all is fine. But when I add that parameter I get the error shown by the OP when I try to add a new Commerce product. – foamcow Oct 10 '18 at 10:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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