Problem with Snippet in a Multisite

Hello,
I have a problem with snippets in multisite posts. My site is primarily in French - the snippets work perfectly. But when I translate the post into English, Spanish, etc. the snippets no longer appear. I delete the snippets in each language and put them back, nothing appears. With the inspector I get :
<!-- Snippet with the requested code MySnippet was not found in the theme. -->

Does anyone know how to solve this problem? Thanks a lot!

Hi @Cyan

This error can occur when the theme changes, and thus the snippet is not found. Can you confirm that all sites are using the same theme?

Hi @daft

I only use one template. The problem seems to have been solved after 4-5 hours, without really knowing how. However, every time I create a snippet and use it in multisite, the same problem comes back. I empty my browser’s cache and the logs in october, I change browser, nothing to do. Is there a deeper cache on october? I work mainly on online sites, so I can’t say if this problem is persistent on a local version.

Hey @Cyan

Yes, there is a snippet cache and it can be cleared with php artisan cache:clear

The cache should clear internally when you modify a snippet, perhaps there is some area/action that is not clearing.

Is it a partial or component based snippet?

Thanks @daft for your reply, I’ll try your tip. My snippet is a partial, integrated in a post Richeditor.

I can confirm that the backend Editor will clear this cache, however, if you are editing partials in the filesystem, this may require manually clearing the cache, or waiting for it to expire.

I hope this helps!

1 Like