Anonymous users cannot see Rotor block images with private file system
lappies - December 26, 2008 - 20:07
| Project: | Rotor Banner |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Firstly thanks for this wonderful work and module
I am using DP5.7 and did get the rotor block to display my rotating images as admin wonderfully with all the new features like fading etc. What a pleasure.
However I cannot see it when logged out.
Have cleared all caches, even installed imagecahe,
Had played with block role access ticked and un-ticked to no avail.
In all cases the block /image space are held and is opened but no image comes through.
I picked this up with recommended DP5 version and then installed the 5x-1.x-dev version but it did not helped.
Any idea what I am doing wrong?

#1
Made some progress to locate the origin to this challenge:
It seems that the images (not the block) is not shown for Anonymous users if the file system is set to private compared to public.
How did I come to this conclusion.
Firstly I am using drupal 5.7 and the latest rotor 5x.1x-dev done over newyear 2009.
Secondly I followed the same issue in the issue queue http://drupal.org/node/256412 but none worked and the only thing I could not test that I could not enable or disable block cache in DP5. Maybe someone can help me out on this one in DP5 but I think you can only do it in DP6
.
Lastly I have a single codebase multisite install and when experimenting it turns out with caching on or off (under performance) it is only displaying it to anonymous users in the site where the file system is public.
Had even a look in Explorer and there the rotor block is showing but the file(picture not), while the files image is there but empty.
Hope this is replicable and it can help us move closer to the solution. thanks again for all the wonderfull work and what a pleasure it is to use the module.
#2
I am having this exact same problem. Drupal 5.7 - Rotor Banner 5.x-1.x-dev I updated this from the stable version to see if it would fix it. No change.
All databases were updated. No cache on. File system is private.
Pictures do not show up unless you login. Can see the block no problem but the images are not displayed.
http://nystea.com/
Visit our sponsors at the top of the page
#3
Any help with this please?
#4
@neoweo: I'll try and get onto this later on today or tomorrow. It seems clear that the problem is todo with using private file system so I have changed the title of this ticket to reflect that. Just to confirm, could you please try setting your file system to public and see if the problem is rectified?
#5
The images were visible when I switched the file system to Public.
#6
Should be fixed in CVS. Ensure you run update.php.
#7
I uninstalled the old version.
Installed the new one.
Ran update and got this error on update.
Fatal error: Call to undefined function mime_content_type() in /var/www/vhosts/nystea.com/httpdocs/sites/all/modules/rotor/rotor.install on line 87
Drupal 5.7
Configuration file Protected
Database schema Out of date
Some modules have database schema updates to install. You should run the database update script immediately.
File system Writable (private download method)
GD library bundled (2.0.34 compatible)
MySQL database 5.0.58
PHP 5.2.8
PHP register globals Disabled
Unicode library PHP Mbstring Extension
Web server Apache/2.2.3 (CentOS)
jQuery Update Installed correctly
The current installed version of jQuery is 1.2.6
#8
oops. should be fixed in cvs now.
#9
Deleted all the files afte uninstalling
Downloaded and installed latest cvs file
ran update got these messages
Fatal error: Call to undefined function mime_content_type() in /var/www/vhosts/nystea.com/httpdocs/sites/all/modules/rotor/rotor.install on line 87
user warning: Unknown column 'file_path' in 'rotor_item' query: ALTER TABLE rotor_item CHANGE file_path fid int(10) unsigned NOT NULL in /var/www/vhosts/nystea.com/httpdocs/includes/database.mysql.inc on line 172.
The update process was aborted prematurely while running update #5100 in rotor.module. All other errors have been logged. You may need to check the watchdog database table manually.
#10
Then you didn't checkout the latest CVS. Ensure you have checkout out from the DRUPAL-5 branch.
If your installing from fresh (you have actually uninstalled rotor, rather than just replacing it with the latest), update.php shouldn't really be doing anything. It should only run for updates of existing installs. But it seems that's not the case. That should now be fixed in CVS too.
#11
I have no clue then. I downloaded the latest. Tried everything. It is still doing the same thing. Can see images when logged in but no images show up when not logged in.
Thanks for your help but I can't get it to work, I will have to ditch this module and make a sponsors page or something.
#12
that's very strange. I know what the problem was, and it's fixed for sure. Before the fix, I was able to reproduce your problem consistently, but after the fix I am unable to do so at all. It works every time for me weather I'm loged in or not. I'm sorry you can't get it to work but I don't know what else to suggest.
#13
When I looked closer the last update was not working, I got the following message when I ran update.php
The following queries were executed
rotor module
Update #5101
* No queries
Code of the install file downloaded from the link of rotor-5.x-1.x-dev(2).tar.gz
// $Id: rotor.install,v 1.1.6.7 2009/03/02 20:14:21 mrfelton Exp $...
function rotor_update_5101() {
$ret = array();
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
$ret = array();
$result = db_fetch_object(db_query('SELECT * from rotor_item LIMIT 1'));
if (defined($result->file_path)) {
$result = db_query('SELECT * from rotor_item');
$ret[] = update_sql("ALTER TABLE {rotor_item} CHANGE file_path fid int(10) unsigned NOT NULL");
while ($rotor_item = db_fetch_object($result)) {
$filename = basename($filename);
$fid = db_next_id('{files}_fid');
$ret[] = db_query("INSERT INTO {files} (fid, nid, filename, filepath, filemime, filesize)
VALUES (%d, %d, '%s', '%s', '%s', %d)",
$fid, $rotor_item->nid, $filename, $rotor_item->file_path, '', filesize($rotor_item->file_path));
$ret[] = db_query('UPDATE rotor_item set fid = %d WHERE nid = %d', $fid, $rotor_item->nid);
}
}
break;
}
return $ret;
}
#14
No queries were executed because this update has already been run (or, you installed from fresh and it doesn't need to). That shouldn't cause any problems, and if it did, you would know about it as you would be getting a lot of errors and database warnings when creating and editing rotor items, which you haven't mentioned, so I assume you're not.
I really don't know what to do here. I just tried reinstalling the module, reinstalling, creating some new rotor items and they showed up fine. I also tried insytalling an older version and running update.php and that went fine too.
When you said you uninstalled the module, you did fully reinstall it right? (not just remove it from the module directory). After you installd it again. Did you try to add images to existing rotor items? Or create completely new rotor items?
#15
1. I deleted all rotor entries under Site Configuration > Rotor Banner. I deactivated the module then uninstalled it. I deleted all the upload pictures from my files folder.
2. I tried a fresh install of the 1.7 dev. I could not successfully load any entries just got partial entries after i hit submit.
The view gave the following error message
user warning: Unknown column 'fid' in 'field list' query: SELECT fid, alt_text, url, link_target FROM rotor_item WHERE nid = 643 in /var/www/vhosts/nystea.com/httpdocs/includes/database.mysql.inc on line 174.
3. Repeat step 1
4. Installed the recommended version. This work sam as before pictures would not show up unless logged in.
5 Then installed updated it with the dev version same thing as # 2 and got the same error message as # 2.
here is a sql dump of the database after step 4 and 5.
--
-- Table structure for table `rotor_item`
--
CREATE TABLE `rotor_item` (
`nid` int(10) unsigned NOT NULL,
`file_path` varchar(255) default NULL,
`url` varchar(255) default NULL,
`link_target` varchar(255) default NULL,
`alt_text` varchar(255) default NULL,
PRIMARY KEY (`nid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Dumping data for table `rotor_item`
--
INSERT INTO `rotor_item` (`nid`, `file_path`, `url`, `link_target`, `alt_text`) VALUES (642, 'files/tec.jpg', 'www.techeducation.net.', NULL, 'TEC'),
(643, 'files/pasco.jpg', 'http://www.pasco.com/', '_blank', 'Pasco''s');
#16
This makes no sence to me. That table dump you got is wrong. Look inside rotor.install and you will see:
<?phpfunction rotor_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {rotor_item} (
nid int(10) unsigned NOT NULL,
fid int(10) unsigned NOT NULL,
alt_text varchar(255) NULL,
url varchar(255) NULL,
link_target varchar(255) NULL,
PRIMARY KEY (nid));"
);
drupal_set_message(t('Rotor Banner installed.'));
break;
}
}
?>
It simply doesn't create the table you just did a dump of. That table is the one that was created in 1.7, not the latest -dev code. Compare what is in your rotor.install what mine. Comoare the first line of your rotor.install with mine, which reads:
// $Id: rotor.install,v 1.1.6.7 2009/03/02 20:14:21 mrfelton Exp $Do you have another copy of Rotor laying around somehwere? In a different sites folder?
#17
ok. Please try with latest code in CVS. I don't have the problem fixed 100% just yet, but I believe I have narrowed it doe to a permissions issue. Please try the following:
a) enable the upload module
b) grant anonymous users the 'view uploaded files' permission
c) grant anonymous users the 'administer nodes' permission
I believe this should work. However, anonymous users should clearly not have the 'administer nodes' permission but I'm still trying to get to the root cause of the issue. Please let me know.
#18
Same problem here. Installed rotor (regular version) on Drupal 5.15 with private file system set. The rotating banner works fine for me as an admin (maybe as well for logged on users), but it doesn't show when not logged on - on neither platform/browser. Following the suggestions of this thread I dl'ed and installed the .dev version from March-09, but things changed only slightly: the rotation doesn't work for the admin user anymore, not logged on users still see just a white space where the banner should be. The banner code is in the page source, and I double checked file permissions on the server.
Following advice #17 I made the suggested changes, but that didn't work / nothing has changed.
Follow up:
As I couldn't get it to work with private file system, I switched that site to public and everything worked as advertised. But some other things are broken now: there are no links attached anymore -- the links are entered in the settings of the banner, but don't show up in the page source, and looking up the settings, all the fields are blanked… Re-entering and uploading also removes the banner path from the record, so instead of a banner you get the broken image path symbol rotated. Hm. The only cure so far is removing the entry and doing it from scratch again -- but still the link is missing. This is with the dev code from March, 09th…
#19
Could part of the problem be that people are trying the -dev version rather than CVS?
I've hit this issue too (6.x-2.0), but haven't tried checking CVS out yet - will report back after I do.
#20
The -dev version is the same as the CVS version (well, the -dev version is created every 12 hours from the CVS version, but right now, its the same).
#21
@NigelCunningham: Please try following the advice in #17 too. This works for me every time (I have tried uninstalling and reinstalling the module, reinstalling Drupal... everytime, following the steps in #17 ensures that anonymous users can see the rotor items).
#22
Right. an hour later, and I'm positive I have it fixed :D
Please check out the latest CVS code. You do not need to grand 'administer nodes', but you do need to:
1) install upload.module
2) grant anonymous users 'view uploaded files' and 'access content' permissions
Please let me know if this works now. I'd really like to get this bloody ticket closed.
#23
Thanks for the reply.
Unfortunately I did as requested, but I'm trying 6.x-2.0 and you don't seem to have applied the patch for that.
I did try following the steps in comment 17, but to no avail.
Oh, and in my case, I can't view the images even as the Administration user. If I switch to public downloads, it works again straight away.
#24
@NigelCunningham : This issue is relating to the Drupal 5 version. Please try the latest -dev version for Drupal 5 and confirm if the changes I made fixed the issue.
#25
@NigelCunningham: Also, your issue sounds different as you can not images for both anonymous and authenticated users - However, I have managed to confirm your problem and have made some changes in CVS to the Drupal 6 tree. Please give it a try with a checkout from CVS (or wait a few hours for the next -dev release)
#26
Okay; will do. Thanks - and sorry for not noticing the version number difference earlier.
#27
New attempt at a fix in CVS. It's working for me on two different local Drupal installs. I really hope this is it fixed now... I know I said that last time!
#28
Is anybody still experiencing this problem? Does using the 5.x-1.x-dev version fix the issue?
#29
I'm on Drupal 6 now. Sorry that I can't confirm the fix.
Thanks for all your work!
#30
Closing this ticket due almost 5 months of inactivity. Nobody has confirmed if the problem still exists or not, so I can only assume that this means it is indeed fixed. I will make a new release for the 5.x branch which incorporates the fix shortly.
#31
Automatically closed -- issue fixed for 2 weeks with no activity.