Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough

File this under "things which make you say 'hmmmm...' "

Parent Feed: 

Sometimes, when troubleshooting a Drupal issue on a site, it's best to determine how much time you are willing to spend on fully solving an issue and be willing to accept a reasonable compromise. We encountered such a situation recently with a rather odd issue: If an authenticated user attempted to post a comment on any of the German blog posts here, they were unable to complete the operation since the "save" button was missing ("preview before save" was required) and for some odd reason, "preview" was not working for admin or other authenticated user roles. If logged out, there was no problem. Actually, it took a while to determine it was the preview, itself, that's not working. We also determined that this may be a bit obscure and could take time to troubleshoot and be better put on the "back burner" for now.

If you want to post a comment, please log out and then try again...

Preview of comments on German blog posts only works for anonymous user

The issue was that we had comment settings on blog post configured to "preview required". It worked fine on English posts, but on German posts, the "preview" would never appear, so neither would the "Speichern" ("Save") button ever be available. Oddly, this issue was only seen on German posts, and also only seemed to affect authenticated users. If a user was not logged in (was seen as an "anonymous user"), they would get the preview and then be able to save their comment.

The simple interim solution: Make 'Preview Comment' Optional...

Simple solution - Make preview optional instead of required.

Preview was set to 'Required' in the Comment settings for the content type, "Blog Entry". Since it wasn't immediately apparent what was interfering with the preview functionality for authenticated users posting comments on the German blog posts, when the issue came to my attention, I immediately set this configuration to "Optional", which meant that while the "Preview" button still doesn't work for authenticated users posting comments on German blog posts, they can at least save their comment without logging out and making their comment as "anonymous". This was a workable interim solution which I had time to implement.

Troubleshooting... trying different things to determine a pattern...

During troubleshooting of this issue, I noticed that an older "localhost" (development) installation of the site worked as expected, even though it also included the language switching by domain and almost entirely the same configuration. What was different? Well, my older localhost was not up-to-date and had a slightly outdated version of the Cocomore Drupal Core. It also had a new version of Captcha (there is a hidden Captcha on the comment form). I wondered, first, whether the Captcha module could be involved, so I turned off Captcha for the comment form and found the problem persisted. Admin and other authenticated users still could not get a 'preview' of a comment posted on a German blog post.

After restoring Captcha for the comment form, I decided to check whether authenticated users (with rights to create a blog entry) could preview a German blog entry node. I determined that preview worked, on both the localhost and production sites when creating German or English blog entry content. So the issue really is limited to comments. I also tried changing the input format for the comment (as "admin" I could select "full HTML" instead of our "blog HTML" input format). But the admin user could still not see a preview.

Wondering whether this affected other content types, I tried responding to a forum post in the German section, where "preview required" also seems to be set. The preview worked as normal. So far, this issue only seems to affect previews of comments on blog entries.

There are more things I could do to troubleshoot an issue like this, but it takes time and simply not having a functional preview of comments, while not ideal, is also not worth wasting a lot of time on, if none of the "obvious" troubleshooting steps yields more useful information. For now we will just have no "preview" of comments added to German blog posts, at least for authenticated users. This is ameliorated by the fact that the authenticated users can edit their comments, so can use "save" (and then "edit") in place of preview if they notice any real need to fix something.

Has anyone else seen something like this?

Any ideas? If you have experienced a similar issue and you did happen to track down the cause, please comment here. In the meantime, I'll simply be paying attention this issue and see if it clears up "on its own" (e.g. after another core update or something) and/or keep my eyes open for possible causes or solutions. You can't always justify spending a lot of time getting one small feature of a site "perfect", especially if the "client" is yourself, but these things can be puzzling till the cause is identified.

In any case, I trust I'll know what's going on before too long, but won't give high priority to solving this issue, at least not for now. Sometimes it's best to just keep such issues in the list of "things which need an explanation". There are plenty of other things which are higher on my current "to do" list. At some point, I'll have other reasons to get my development version of this site back in complete sync with the production server and maybe, then, I'll be able to replicate this problem on my local machine, and do things to troubleshoot it that I'd rather not do a on production server. Until then, this is a just a bizarre quirk of our production environment. I'll post an update when the mystery is solved.

Original Post: 

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web