G1 -> G2 map fails with blank page when destination album is hidden

aebenjam

Joined: 2009-09-13
Posts: 8
Posted: Sun, 2009-09-13 01:56

Hopefully this isn't a repeat post. (I did search and try the various debugging steps. Honest.)

I'm working on migrating my content from G1 to G2 and I've found an odd quirk. My G1 to G2 maps work fine after I put the mod_rewrite rule in place under the G1 .htaccess - except where the destination album is hidden. If I un-hide it, the map works like a charm, but if the destination is hidden, I get a blank page.

Oddly, I don't see any error messages, at all, in the server logs. I turned on the debugging in config.php (set it to buffered) cleared my various caches - browser and database side - but still the same result. I even tried re-importing the content. If the destination album is hidden, blank page. No error, just blank.

Needless to say, I have some hidden content on the G1 instance that I want to auto-redirect to the G2 instance. Sadly, the system I'm testing on is not public and I'd like to avoid publicizing the URLs in question, although I can create a new hidden folder for testing if you like.

Thanks for any help you can offer,

Adam Benjamin


Gallery version = 2.3 core 1.3.0
API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
PHP version = 5.2.9 apache2handler
Webserver = Apache/2.2.11 (Fedora)
Database = mysqli 5.0.84, lock.system=flock
Toolkits = ArchiveUpload, Exif, Ffmpeg, Getid3, ImageMagick, LinkItemToolkit, NetPBM, Thumbnail, Dcraw
Acceleration = none, none
Operating system = Linux pistol.midnightclear.org 2.6.27.30-170.2.82.fc10.i686 #1 SMP Mon Aug 17 08:38:59 EDT 2009 i686
Default theme = carbon
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.13) Gecko/2009080317 Fedora/3.0.13-1.fc10 Firefox/3.0.13
Rows in GalleryAccessMap table = 8316
Rows in GalleryAccessSubscriberMap table = 2947
Rows in GalleryUser table = 2
Rows in GalleryItem table = 2945
Rows in GalleryAlbumItem table = 92
Rows in GalleryCacheMap table = 0

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Wed, 2009-09-23 12:54

Is the album hidden in G1 or G2?

Theoretically, you should be able to remove all your G1 content once you've migrated to G2 and the rewrite rules should be enough to redirect to G2.

If you're hiding the album in G2, how are you hiding it, with permissions or the hidden items plugin?
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
aebenjam

Joined: 2009-09-13
Posts: 8
Posted: Wed, 2009-09-23 13:03

Sorry I didn't explain. The content that is hidden is in the G2 instance. (It is also hidden in the G1 instance - but that doesn't seem to be the determining factor here.) I'm putting the redirect (rewriting) rules in place for the G1 instance and leaving it be.

And I'm hiding the content in G2 using the hidden items plugin. (I'd forgotten that was a plugin in G2.) If the album is hidden, or its parent is hidden, the redirection from the G1 instance results in a blank page. If you unhide the content in G2, the redirection works fine.

Thanks for any guidance you can offer.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Wed, 2009-09-23 13:38

Do you get a blank page if you try to access the G2 url directly?

Can you PM me the following:
--the rewrite rules you are using
--a link to see this happening
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
aebenjam

Joined: 2009-09-13
Posts: 8
Posted: Wed, 2009-09-23 13:49

Sorry - not sure what you mean by PM'ing you. The rewriting rules I'm using are those provided within the G2 migration page. As for a sample URL, I'm working on a test version of of my G1/G2 instances which is on a home machine (ie. behind a firewall) rather than the public site - and as I haven't solved all the wrinkles, I haven't put the rewriting rules in place on the live site. I was hoping that anyone testing could recreate it via a trivial instance of both since it doesn't seem to be specific to my instances... but if it's really necessary, I can go to the effort of setting up new G1 and G2 instances to recreate the problem.

Sorry for the complications, and I greatly appreciate your considering the issue.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Wed, 2009-09-23 15:22

Sorry, PM = Private Message. Just click on Write to author

Get something working on a public site where you've duplicated this and I'll take a look.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
aebenjam

Joined: 2009-09-13
Posts: 8
Posted: Mon, 2009-10-26 03:09

Sorry it took so long to provide an example. Here's the URL to the G1 gallery:

http://www.midnightclear.org/adam/gallery/Work-ish-Things

Here's the G2 album where it should redirect to:

http://www.midnightclear.org/adam/gallery2/v/Shutter-Clicks/Work-ish-Things/

Note that when the G2 album is NOT hidden, the redirection works, and the URL I see in my browser is this:

http://www.midnightclear.org/adam/gallery2/main.php?g2_itemId=44002

But when I hide the G2 album, the redirection results in a blank page - and no errors that I can see in any of the logs.

Let me know if you need more information.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Mon, 2009-10-26 03:27

Please post the rewrite rules you are using and where they are located.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
aebenjam

Joined: 2009-09-13
Posts: 8
Posted: Mon, 2009-10-26 13:18

In the .htaccess of the G1 gallery directory:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !gallery_remote2.php
RewriteRule (.*)$ /adam/gallery2/main.php?g2_controller=migrate.Redirect&g2_path=$1 [QSA]

 
aebenjam

Joined: 2009-09-13
Posts: 8
Posted: Wed, 2009-10-28 19:19

Not sure if it's a related bug or not (let me know if you want me to post a new message) but I noticed that if you browse directly to an Image's page under a hidden tree, it prompts you for a username/password - which is just wrong. The area's not password protected. For example:

http://www.midnightclear.org/adam/gallery2/v/Shutter-Clicks/Work-ish-Things/img_0031.jpg.html

If you've been to the parent area first, you're fine - but go straight there, and it prompts for username/password.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Wed, 2009-10-28 19:31

I think what we're getting down to is there is possibly a bug in how this works with the Hidden Items plugin or because of technical issues in how the Hidden Items plugin works.

Ah, it's not a bug:

Quote:
Unlike Gallery1's hidden feature, with Gallery2 the anonymous user must visit the hidden album URL directly before they are able to view any items within it.

http://codex.gallery2.org/Gallery2:Modules:hidden

That's how that plugin works. You have to visit the album first, then you can visit the items.

After visiting the album, does the G1 redirection work properly? You may need to not have it hidden or instead of using the Hidden Items plugin, use Permissions and be forced to login. You may be able to use the password protected plugin as well to avoid creating user accounts for everyone you want to have access:
http://codex.gallery2.org/Gallery2:Modules:password
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
aebenjam

Joined: 2009-09-13
Posts: 8
Posted: Wed, 2009-10-28 19:40

Ah. Okay, one mystery solved. And I suspect (fear) this also solves the other mystery. No... it didn't fix things to view the G2 album before trying the G1 redirection... but it's probably related.

Thanks very much for your assistance. Sounds like the ideal solution here will be social engineering (point people at the hidden albums directly) or password protect it.

Thanks again for taking a swing at it.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Wed, 2009-10-28 19:42

One way to test.

Disable the hidden items plugin, then try accessing one of those G1 URLs
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
aebenjam

Joined: 2009-09-13
Posts: 8
Posted: Wed, 2009-10-28 19:55

As mentioned in a previous post, I'm quite sure that un-hiding the album (you don't even have to disable the plugin) restores the G1 -> G2 redirection to proper operation. It's definitely related to the "hidden-ness" of it. I had forgotten that the Hidden Items functionality is an addon and not core to the Gallery - hence my original post. I suspect that, given the current migration to G3, I'll simply have to tolerate the new "features" for now.

Thanks again.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Wed, 2009-10-28 20:00

G2 will still be supported. Just not enhanced.

I suspect it won't take long for community involvement for G3 to get 3rd party themes and modules up to the level or even surpassing G2.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here