We launched the site with wysiwyg_fields-enabled images, but there seem to be quite random rendering problems - sometimes the node output includes the [wysiwyg_field.... -tags instead of rendered images. Any ideas?

Here's a link showing that the problem exists in quite large numbers: http://www.google.fi/search?q=site%3Ablogit.yle.fi+wysiwyg_field
I'm logged in and when I click on an article from that Google page, I also see the tags non-rendered. Refreshing the article page a couple of times usually gets the tags rendered again.

Comments

deciphered’s picture

Status: Active » Postponed (maintainer needs more info)

Hi Tormu,

I'll need to test things out to see if I can reproduce the issue, any tips you have, or access to a site with the ability to reproduce would be helpful.

Cheers,
Deciphered.

tormu’s picture

We will be testing this problem more thoroughly later this week to see if it's really wysiwyg_fields-bug or a bug somewhere else. I'll inform here right away when we get some new info.. We didn't see this problem until the site (http://blogit.yle.fi) was live, so it might have to do with something conflicting with something else.

deciphered’s picture

Its the Filter component, so there could be a conflict with another Contrib filter, at least that's where I would start looking.

wroxbox’s picture

This is just a good guess by Olli. The filter works correctly.

In some situations the next function will not return filter.inc to be included.

foreach (module_list() as $module) {
  if (file_exists($file = dirname(__FILE__) . "/includes/{$module}.inc")) {
    require_once $file;
  }
}

We'll try to reproduce.

deciphered’s picture

Very curious, if you can show any evidence that module_list() isn't returning Filter then there is bigger problems here than Wysiwyg Fields not working properly.

wroxbox’s picture

As we talked in IRC about the $SESSION issue. Here is patch to use drupal_static.

There is also some php strict error fixes included in the patch.

We haven't yet tested if this really fixes the initial problem, but this is one step further.

wroxbox’s picture

Hi Stuart!

We simplified the patch to not have any cache_set get.

olli’s picture

Status: Postponed (maintainer needs more info) » Active

Hello,

To reproduce the issue you need to make one extra node_load before actually viewing the node. In our case it appears to be redirect-module. Steps to reproduce:

1. Install standard drupal, wysiwyg_fields and redirect
2. Create an article having some images added via wysiwyg_fields
3. Clear caches (or truncate cache_field)
4. View the article - tokens are shown
5. Refresh the page - images are shown
(repeat steps 3-5)

Instead of enabling redirect module you could also add the following line in page.tpl.php:
print isset($node) ? render(node_view(node_load($node->nid))) : '';

What happens is that wysiwyg_field-tokens are not processed during the node_load called in _wysiwyg_fields_filter_process() and the result of this node_load is cached statically by entity controller. Therefore any subsequent call to node_load will return a node with unprocessed wysiwyg_field-tokens.

As a workaround we added $vid parameter to node_load in _wysiwyg_fields_filter_process(). Any other suggestions?

olli’s picture

I think another way around this would be to temporarily disable caching of text formats, process the tokens, restore caching of formats and reset the static cache of entity controller for wf_nid.

Is wysiwyg_fields going to support revisions?

deciphered’s picture

It's an interesting issue, and I have been able to reproduce it and am still trying to determine the correct fix for the issue.

The workaround you described in #8 won't work as I've moved away from node_load in favour of entity_load so that Wysiwyg Fields can be fully Entity agnostic.

I'm interested in hearing what sort of revision support you'd be interested in and how you would expect it to work, it's not something I've put a huge amount of though into as of yet.

nicksanta’s picture

Issue summary: View changes

We've experienced this issue intermittently since we launched our website 2 years ago.

I finally have time to take a look at it, will let you know if I come up with a workaround or solution.

nicksanta’s picture

Upgrading to the latest 7.x-1.x-dev snapshot has seemed to fix the issue.

deciphered’s picture

Status: Active » Fixed

Marking as fixed.

As an aside, Wysiwyg Fields 7.x-2.x uses standard tokens (as defined by a newly required module) and they are processed by the required Token Filter module, so this shouldn't become any issue anymore, atleast not a problem with Wysiwyg Fields.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.