0

This question is identical to Resaving blog entries keeps failing except that I'm not finding any [error] or [warning] in my log entries.

I have changed my entry URL format for the section named Events from

{mainCategory.last().uri}/{slug}

to

{mainCategory.last().uri}/_entry

as described here: Is it possible to view 'Expired' entrys on the front end? and when I hit save on the section page, then it immediately gives the failed task: Resaving Events entries. Any thoughts?

UPDATE

OK, I did find this error: 2016/12/18 02:26:41 [error] [application] Encountered an error running task 422 (ResaveElements), step 2 of 197: Encountered the following validation errors when trying to save entry element "Transforming Work" with the ID "19": - URI "fort-collins/weekly/buddhist-meditation-classes/_entry" has already been taken.

I'm not sure quite what it means. There's only one entry named Transforming Work.

4
  • I'd recommend going through this: craftcms.com/support/stuck-tasks
    – Brad Bell
    Commented Nov 6, 2016 at 4:22
  • I've gone through that pretty thoroughly. No sign of relevant PHP errors or other errors or warnings in the various logs. Any further suggestions?
    – kr37
    Commented Nov 10, 2016 at 2:48
  • Would it be effective to make the change in PHPMyAdmin? I find {mainCategory.last().uri}/{slug} in only one entry in this table: craft_sections_i18n. But I'm figuring that Craft does some processing when saving, such that making the change manually in that one spot wouldn't actually change anything?
    – kr37
    Commented Dec 15, 2016 at 16:17
  • Correct. If it immediately fails, it's not likely an environmental limitation. Reproduce, then check craft/storage/runtime/logs for [error] and you should see what's tripping it up.
    – Brad Bell
    Commented Dec 15, 2016 at 23:48

1 Answer 1

1

There's only one entry named Transforming Work.

That might be true, but you’re telling Craft to store the entry with an URI

fort-collins/weekly/buddhist-meditation-classes/_entry

Change your entry URI format back to something that’s going to be unique for each entry, probably you’ll want to replace the hardcoded string _entry with the dynamic variable {slug} again, or better, do what is actually described in that Stack Exchange answer you linked to and don’t use the default Entry routing at all (disable “Entries in this section have their own URLs”) and rebuild the route with a custom one (see the Craft docs on Dynamic Routes).

1
  • 1
    Thank you, Carl. I was getting confused by news/{slug}news/_entry in that other answer. What I need is very simple, not much more than a template called archive.html that contains {% set params = { section: 'events', status: 'live,expired', limit: '1000', order: 'startDate desc' } %} {% for entry in craft.entries(params) %}<p>{{ entry }}<p>{% endfor %}. So thank you very much for getting me back on track.
    – kr37
    Commented Dec 19, 2016 at 1:43

Your Answer

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

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