I'm creating a new node as an Authorized logged in user. I have a content type with several CCK fields.

I enter a Title, Body, and fill some values for the CCK fields. I click Submit/Save.

Now what do I see, when boost is enabled? I see, Title, Body,... but all empty CCK fields. So I check the database: all values are stored.

Finally, I disabled Boost, and voila: CCK values are shown.

What the f***? I don't think that should happen. Apparently Boost caches empty CCK values on the node/add page, and then displays those empty values from cache on the node/view page.

Comments

hansrossel’s picture

Same problem here, with boost enabled, the cck values are not visible after submitting a node. When editing the node right after submitting the cck fields are empty.

mikeytown2’s picture

Priority: Normal » Critical

Man thats weird...

Have you tried the latest dev that came out today? Whats the type of cck field your using? is the node add/edit page in the cache for some weird reason?

mikeytown2’s picture

Status: Active » Needs review
StatusFileSize
new3.55 KB

try this patch & update your .htaccess file.

  RewriteCond %{REQUEST_URI} (^/(admin|cache|misc|modules|sites|system|themes|node/add))|(/(comment/reply|edit|user|user/(login|password|register))$) [OR]
Anonymous’s picture

Thanks mikeytown, but the patch doesnt help. It gets even weirder: the newly added node is not yet in the cache... I mean, in cache/gz and cache/www.domain.com that node is not stored yet. So it has nothing to do with htaccess...

- I'm using CCK text fields and and select fields, and links fields.
- It only happens on node creation.

CCK field simply "disappear", although they are stored in the database.

- Clicking "Clear cached data" on bottom of admin/settings/performance makes them come back.
- Clicking "Clear ALL boost cached data" does NOT
- Clicking "Clear core page cached data" does NOT

Maybe this is a conflict between boost and drupal core caching? I'll do some more test now.

mikeytown2’s picture

StatusFileSize
new5.03 KB

here's another stab in the dark, since I can't reproduce this. Taking a guess that having init in a function name is a bad idea.

Anonymous’s picture

Doesn't help either... I even excluded all node/* pages from boost cache, on the boost settings tab. Also core caching and gzip were off. Just using regular boost, but still no help.

I noticed that all CCK info exists, except the values. I can call $node->content for CCK (because the page hasnt been boost cached yet.) But the string hold everything except the actual values.

For example:

$node->content['group_percent']['group']['field_score_percent']['field']['items'][0]['#item']['value']

...is supposed to exist, but after node creation with boost, all you get is up to:

$node->content['group_percent']['group']['field_score_percent']['field']['items']

The last value part is missing... I really have no idea either.

Anonymous’s picture

Oh one more thing, all my CCK fields are within CCK's fieldgroup.module groups. I found out that the Mollom module is incompatible with that (a _form_validate function somehow messes that up). I'm getting the feeling this may be related too. Since with mollom also CCK values "got lost".

hansrossel’s picture

I will try the patches tomorrow, but can add that I'm using CCK field permissions. My cck fields are not in a fieldgroup.

Anonymous’s picture

Hmm, i tried without fieldgroup, doesnt solve it. Also using CCK field permissions.

mikeytown2’s picture

Title: Boost caches CCK fields BEFORE a node published » Boost & CCK field permissions strangeness

doing a clean install, going to see if I can replicate, as I was not using field permissions.

mikeytown2’s picture

Status: Needs review » Needs work
mikeytown2’s picture

Version: 6.x-1.0-rc2 » 6.x-1.x-dev

CCK 2.5
- Content
- Content Permissions
- Text
Drupal 6.13
Boost 6.x-1.x-dev Aug 11

Did a fresh install, using a text field and trying different permissions. I don't get a bug. If I can view the field, then it's shown. If clearing the cache fixes the problem then it has to do with the 'cache_filter' table, as this holds the nodes output after going through the various filers like 'Filtered HTML' or 'Full HTML'.

Just wondering is
Turn off clean url's for logged in users
turned on?

What else is there so I can replicate the bug?

mikeytown2’s picture

I have an idea on how to pin-point this error... since I have no idea where the error is coming from (since I can't reproduce it).

Try by adding return TRUE; to the top of the function, so that function is skipped. If the error is still there, then return the function back to it's original state. Here's the list of functions to try, one at a time. These are all the hook_* Implementations.

  • boost_nodeapi
  • boost_block
  • boost_init
  • boost_help
  • boost_exit
  • boost_menu
  • boost_form_alter
  • boost_cron
  • boost_flush_caches
  • boost_comment
  • boost_taxonomy
  • boost_user
  • boost_theme
Anonymous’s picture

No, it's in table cache_content. After creating a new node with my problem, I can see a BLOB for this node in the cache_content table. When I manually remove that single row, and refreshed my node page, then the CCK fields values were shown again.

So with Boost active, the data stored into cache_content does not hold CCK values. It's lost somewhere...

Clean URLs is on for all users. And I'm using APC cache on my linux server. Can that influence anything?

A workaround is to automatically clear the relevant cache_content row after node creation. Hope you have some more ideas...

Anonymous’s picture

Ok, I'll try your functions.

Anonymous’s picture

OK Bingo! -- first function boost_nodeapi causes the problem.

It's actually this line:

$terms = taxonomy_node_get_terms(node_load($node->nid));

When I uncomment that one, my problem is gone! I see there's a setting for this in Boost Settings. I'll keep it switched off for now.

I do use a lot of taxonomy modules, such as Taxonomy VTN, Taxonomy Hide and Taxonomy Blocks.

mikeytown2’s picture

Status: Needs work » Needs review
StatusFileSize
new1.03 KB

Interesting that node_load is causing all the problems...
http://api.drupal.org/api/function/node_load

I think I found the solution
http://api.lullabot.com/content_update

btw http://api.lullabot.com/ is like http://api.drupal.org/ but it holds contributed code as well.

Test the below patch, let me know if this does the trick

mikeytown2’s picture

StatusFileSize
new1.4 KB

taking a hint from http://api.drupal.org/api/function/taxonomy_node_get_terms, if the node is loaded with the terms, don't reload it.

Anonymous’s picture

Hi, latest patch is still not working... I run out of ideas...

mikeytown2’s picture

We just need to find the right CCK api. Your sure its the cache_content table that has bad data in it right?

mikeytown2’s picture

StatusFileSize
new1.45 KB

Here's the more extreme version

cache_clear_all('*', content_cache_tablename(), TRUE);

That kills the CCK cache, which isn't ideal, but it narrows down the causes.

We'll probably end up writing a boost_taxonomy_node_get_terms($nid) function. Never give up, when the database is right there.

hansrossel’s picture

Title: Boost & CCK field permissions strangeness » Boost & CCK strangeness

I can confirm that uncommenting the line of #16 also solves my problem, will soon test patches now.

Problem is not related to content field permissions, Content taxonomy or Taxonomy VTN, Taxonomy Hide and Taxonomy Blocks, as I don't have any of these active anymore.

hansrossel’s picture

Patch #21 does not work for me. I am using a stripped down test installation with a very simple content type with title, body and a one line cck text field.

On node/add, the cck field does not appear in the published node after saving the node.

When I edit the node, the cck field appears empty, but refilling the field and saving the node from node/*/edit works correctly. So problem is specifically at node/add.

mikeytown2’s picture

Status: Needs review » Needs work
StatusFileSize
new1.75 KB

Ok the problem is node_load so that has to go.
Solution will be to make my own boost_taxonomy_node_get_tids($nid). Function will be faster then the current way, so not all is lost.

Please test this patch, it should work :)

mikeytown2’s picture

hansrossel’s picture

Status: Needs work » Needs review

Yes! For me patch #24 solves the problem. Thanks!

mikeytown2’s picture

Status: Needs review » Reviewed & tested by the community
mikeytown2’s picture

Title: Boost & CCK strangeness » Boost node_load & CCK cache issues
mikeytown2’s picture

Status: Reviewed & tested by the community » Fixed

committed #24 & #5

Anonymous’s picture

Thanks!!

Status: Fixed » Closed (fixed)

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