when caching is enabled, sometimes the anonymous comment form gets filled up with information from another user. it returns to normal after clearing the cache table.

CommentFileSizeAuthor
#2 field_caching.patch.txt474 bytesluperry

Comments

psicomante’s picture

I get the same problem. Can the content not to be cached?

luperry’s picture

Status: Active » Needs review
StatusFileSize
new474 bytes

sorry, I forgot to update this.

I tracked down the problem and fixed it myself. here is a patch. it's pretty simple, just use "default_value", instead of "value".

mfer’s picture

How can this value not be cached by going with #default_value? Isn't that the reason it can show up on other users pages? The caching.

luperry’s picture

Status: Needs review » Active

currently it uses #value instead of #default_value. #default_value is filtered by drupal, #value is what gets cached.

but yes, you are correct, after further testing, it seems like it still doesn't fix the problem. I had expected drupal to filter #default_value after it caches the page, it seems this is not what's happening.

mfer’s picture

Status: Active » Needs review

To avoid caching the way to go with this might be to have jquery do it.

Christoph C. Cemper’s picture

Is this in the 5.x version? still got the same troubles

is this info being sent out in the html form? I thought they do it via cookie/JS

mfer’s picture

The reason for the problem is that the info is stored in session and when caching gets turned on the info can be put into the cached page that everyone who sees the cached page will see.

Doing it with JS and a cookie is completely possible. Especially, not that jQuery is in core. I keep planning to write this. Maybe that will be my drupal task for the weekend.

Oh, and the problem is in 4.7 and 5.

mfer’s picture

Assigned: Unassigned » mfer

I spoke with Cainan about this. We are going to offer an option to have the remembering done via jQuery. This will only work in web browsers with javascript enabled but shouldn't run into the caching problem.

mfer’s picture

There is now a second method to save the users information via jQuery and cookies. Check out the beta release at http://drupal.org/node/122084. Please, let me know if there are any bugs.

mfer’s picture

Status: Needs review » Fixed

This has been fixed for drupal 5 using jQuery/cookies when caching is enabled. You can find the release at http://drupal.org/node/132977.

This fix doesn't work for 4.7 but the idea works. The fix is to upgrade to drupal 5 and the 5.x-2.0 version of the comment info module.

Anonymous’s picture

Status: Fixed » Closed (fixed)