Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Already synced snippets are inexplicably lost

Status Resolved
Add-on / Version 1.3.5
Severity Critical
EE Version 2.9.0

Kevin Smith

Aug 18, 2014

I had the hardest time reproducing this because it seemed to be happening at completely random intervals. I added a snippet this morning as a file, it showed up in the CP as usual, and I was able to load several pages on the front-end with the snippet rendered as expected. Within a few minutes, this snippet no longer rendered, and I noticed it wasn’t showing up in the CP anymore either. I changed the snippet’s name and it showed up for a few minutes, but then the whole thing repeated itself.

After searching through the support tickets here, I found this one, and your suggestion has so far seemed to take care of the problem. But that’s not really a solution. This could be happening on production sites and we’d never even know about it. What’s causing the snippet to be un-synced from the database in the first place? If the problem is that the hash timestamps are off, how did that happen?

I noticed a potential issue, though I can’t be sure this is the root cause. The unset at line 348 removes a snippet from the settings array, but that array is never re-saved. This means that hashes remain in the extension’s settings even after a snippet is removed from the DB (and that’s actually something I noticed after changing the snippet’s name).

#1

BoldMinded (Brian)

save_settings is called shortly after the _cleanup method, which is where the settings array gets saved back to the db.

Are you running an MSM site by chance?

#2

Kevin Smith

Ah, so it is. Not sure how I missed that.

No, this isn’t an MSM site.

#3

BoldMinded (Brian)

Kevin, what happens if you turn off the cleanup option? I usually run sites with that option turned off.

#4

Kevin Smith

Well, it hasn’t happened again since I uninstalled and reinstalled the extension. I’ll keep an eye on it and let you know.

Login to reply