Sitecake An attempt to save content error the solution

#1

I have figured out what is causing this mysterious error.
#1 An attempt to save content modifications failed. Retrying…
#2 etc
#3 etc

You are using “Repeater containers” sc-content-xxxxx
Let’s say you have index.html and edit.html add a repeat container sc-content-item1 to both pages. Then you choose to change your index and edit from .html to .php pages OR you decide to save index.html as a new page in your code editor manually to (for example) contact.html in attempt to clone it and edit it further etc. This will produce the error. Seemingly because this new page has the original repeat container name? Now to fix it simply use a new name for your repeat containers on all your pages from sc-content-item1 to sc-content-thing1.

So in short what I suggest is you complete your entire site, then at the end when you have no plans to rename or create new pages, add all your repeat containers sc-content-xxx etc.

Hope this helps someone. I also hope Sitecake can fix this issue in the next update.

Question for Sitecake, is there a file or folder to delete so the repeat container data can be rediscovered or refreshed.

1 Like
#2

Thanks for the post, repeaters can be tricky to use on certain occasions. I will try to explain how they work in more detail.

When you start Sitecake for the first time it will go through all HTML and PHP pages and search for content elements, repeaters, navigation, and everything else. Sitecake will save repeater content and create a list of pages where repeaters are. These things are saved into /sitecake-temp/[hash]/tmp/cache/ folder. But, if you start manually changing page names, extensions and generally website structure this might confuse Sitecake. It will try to use the site map and the container map from the cash but the website could’ve been changed.

So the advice is to delete sitecake-temp/ folder so the Sitecake will recreate maps and metadata it uses. Deleting sitecake-temp/ folder will not destroy anything other than a draft (unsaved) editing session if there is one.

I often write HTML code and keep the same page open in edit mode so I can see how it will behave in edit mode. After each HTML change is saved it’s important to refresh the edit mode in the browser (F5) and Sitecake will load changes. This can be done if you are working on a single page ONLY. If you are changing top navigation, adding new pages, renaming, or doing site-wide changes then the refresh is not enough, you need to delete sitecake-temp/ so that Sitecake can recreate the website map and container map.

1 Like
#3

Thanks for the information.