work done in gallery2 doesn't show up in drupal
ivanSB - September 1, 2007 - 10:58
| Project: | Gallery |
| Version: | 5.x-1.0 |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
If I add album/pics from gallery2 they don't show up in drupal unless I login and edit my account.
Looking at what gallery_user.inc does I think the "turning point" is GalleryEmbed::done().
Is there a way to let people add content from the gallery2 interface *and* automatically sync with drupal?
--
Ivan Sergio Borgonovo
http://www.webthatworks.it

#1
I have never heard of such a problem before. So I asked kiz_0987, who is more experienced with this module (esp. 5.x-1.x version) and he wrote: "I have never heard of this either. Where do they not show up (in random image block, or via g2 filter)? Why does he think the 'GalleryEmbed::done()' part is to blame? What is the 'automatic sync with Drupal' part? More details are needed I think." We definitely need more details. Please answer (at least) the questions above, so that we can learn more on the actual problem.
#2
Sorry for being so late to reply...
I'll try to add details.
I just checked with admin user from inside drupal... so no matter where I add the new item or album and which are the privileges of the user I'm using this happens anyway.
I log into drupal, add an item (or album) and it doesn't show in Gallery Grid Image block neither in the http://site/drupaldir/gallery page.
As soon as I go to the user page with which I added the video (http://media.assopoker.tv/d1/user/1/edit) and "resubmit" the user data (even with no change) the new Item/Album appear in Gallery Grid *and* in http://site/drupaldir/gallery page.
In the gallery_user.inc the only thing that is not strictly related to "user data" is the call to GalleryEmbed::done(); that's why I think it is the thing that actually put in sync drupal and gallery2.
Just to be extra clear... as soon as I go to the drupal user edit page and to an "update" the new item/album show up everywhere for every user.
This happen even logging in in drupal to make additions to gallery2, not just if you log into gallery2 and expect to see changes in drupal.
Could it be a cache problem and GalleryEmbed::done(); trigger the cache sync?
BTW is there a way to be updated of any change of the status of this bug report by email? thx
#3
You think its a caching issue and I agree as it seems to be the only plausible cause. Can you please add some details about your server configuration!? An what are your cache settings in Drupal and Gallery2.
- You can go to Issues -> Subscribe (http://drupal.org/project/issues/subscribe-mail) and set subscription option to 'Own issues' for all projects. Then you will get an update notification by mail for all issues you create or comment on. -
#4
Drupal:
admin/settings/performance:
Caching mode: normal
Minimum cache lifetime: none
Aggregate and compress CSS: enabled
Gallery2:
Performance Tuning: no accelleration
But consider that changes appear immediately in Gallery2 but not in drupal... and well I haven't been so patient or I didn't record it scientifically but I got the impression that changes continue to miss in drupal even after a long time (hours?).
Changing the cache setting of drupal DOESN'T change the behaviour. Items/Albums don't appear unless I log in and "edit" the user profile.
It may be a cache issue but it may be tricker than just what it may seem... a system to trigger GalleryEmbed::done(); or be sure the change will reach drupal would be welcome.
thx
#5
I did some test and even running GalleryEmbed::done(); doesn't solve the problem.
I added this snippet of code to see if I could get around this problem:
/**
* Refresh Gallery2 cache
*/
function gallery_refresh() {
list ($success, $ret) = _gallery_init();
if (!$success) {
$err_msg = t('Unable to initialize embedded Gallery. You need to
configure your embedded Gallery.',
array('@link' => url('admin/settings/gallery')));
gallery_error($err_msg, $ret, TRUE);
return;
}
$gallery_user = drupal_clone($user);
GalleryEmbed::done();
return true;
}
but it didn't solve it.
Anyway *everytime* I add new stuff inside drupal or directly in gallery2, updates doesn't show in drupal unless I go into the user edit page and I "update" the current user data (even without change).
So whatever magic happens during user update it should happen in
gallery_modify_user($user, 'update');
or in the core user module.
What could be the relationship between user update and change finally showing up in drupal too?
Other kind of "update" of the cfg make the changes appear, eg. changing the configuration of the block admin/build/block/configure/gallery/2 or changing the checkbox of the throttle... (that doesn't mean really change the setting... just submit the form...)....
Something that may trigger a cache refresh?
Other stuff refresh properly, but gallery needs this black magic... ???
thx
#6
Trying to be more syntethic and narrow down the sympthoms:
- any authorized user add/delete content to gallery through gallery *or* drupal interface
- new content show up/disappear immediately to the user who added it in all various drupal blocks
- new content *doesn't* show up for other users authenticated or anonymous
- if any user:
* update his profile
* update block setup
* update block throttle setting
* maybe other things
content show up for anyone
updates may be "blank" updates, no change to block setup, no change to user profile...
changes appear immediately in /user/ even before login
Stuff seems to work if throttle module is completely disabled!
#7
In Drupal 5 pages are never cached for authenticated users (but for anonymous users only), so I dont see any reason why this should be. Do you have any additional cache-related modules (block_cache, etc.) installed? Does it make any difference to call
cache_clear_all();?Throttle is a completely new factor here. I will need to test with this module enable. As I'm quite busy atm it may take a few days to set up a debug environment :/
#8
I'm willing to help as soon as I understand how drupal cache works... but one of the things I noticed is that everywhere in gallery module if($maycache) is missing.
#9
I hope that everything is working for you now.
------------
Feel free to reopen but please look at the latest version first! It's probably fixed.
http://drupal.org/project/gallery
Closing (cleanup)