The flvmediaplayer_profile_edit_form_submit function not correctly clears the cache table.
You call this:
cache_clear_all('%'. $form_values['name'], 'cache_flvmediaplayer', true);

But this doesn't do anything, because in the cache_flvmediaplayer table there are items like this:
"flvmp_112_d41d8cd98f00b204e9800998ecf8427e"

I fixed this temporary by this change in flvmediaplayer_profiles.inc:
change:

cache_clear_all('%'. $form_values['name'], 'cache_flvmediaplayer', true);

into:

cache_clear_all('*', 'cache_flvmediaplayer', true);

Need a better solution.

CommentFileSizeAuthor
#4 flvmediaplayer-clear-cache.patch782 bytesmrfelton
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

arthurf’s picture

Actually, in the dev release its:

<?php 
cache_clear_all('flvmp_%'. $data['flvmp_profile_name'], 'cache_flvmediaplayer', true); 
?>

which should take care of the issue. I haven't written the migration script to take your current configurations to the dev version configuration options which is the part that is still out standing.

mrfelton’s picture

Version: 5.x-4.x-dev » 6.x-1.0-beta3

I find that no matter what changes I make to my profile, the node outputs the player the same. Looking at the cache_flvmediaplayer, I can see that it has an entry in there for my node, and it is not getting updated when I:

a) alter the player profile
b) edit the node
c) flush all my caches using the devel module.

Infact, I can find no way to clear that cache out at all.

mrfelton’s picture

It seems that the cache has been stored without the profile_id appended.

The name of my profile is 'default'.
The cache entry has an id of 'flvmp_1_'
I think it should actually be 'flvmp_1_default'

Because in flvmediaplayer_profile_edit_form_submit() you call:

cache_clear_all('flvmp_%'. $data['name'], 'cache_flvmediaplayer', true);

where $data['name'] holds the name of the profile ('default' in my case).

So the question is... why is the cache being saved without the profile id appended?

mrfelton’s picture

Status: Active » Needs review
FileSize
782 bytes

I think the problem was that you were not passing the profile_id to the theming function when embedding the player in hook_nodeapi

on line 131, I changed:

          if ($node->flvmediaplayer_config['player_node_body'] || ($a3 && $node->flvmediaplayer_config['embed_teaser'] )) {
            flvmediaplayer_insert_player($node, theme('flvmediaplayer_display', $node));
          }

to:

          if ($node->flvmediaplayer_config['player_node_body'] || ($a3 && $node->flvmediaplayer_config['embed_teaser'] )) {
            flvmediaplayer_insert_player($node, theme('flvmediaplayer_display', $node, $node->flvmediaplayer_config['embed_profile']));
          }

and all seems good now (with limited testing). Patch attached.