Image Chooser not showing albums or pictures

kmulh

Joined: 2007-09-20
Posts: 3
Posted: Sat, 2007-10-13 23:44

I am using WPG2 v3.0.2, WP 2.3 and Gallery 2.2.3 and when I create a post for my blog and click the WPG2 icon to add pictures, the Image Chooser comes up but says there are no albums or pictures to display. The Sbar Grid and Album tree widgets are working fine and the image chooser worked in the past. It appears to be some sort of authentication issue between my wordpress session and Gallery2, but I am not sure what I changed to break it. I have verified that the account I am using is an admin in both WP and G2 and it has access in both.

Does anyone have any ideas how to fix this? Thx.

 
ClimbingMonkey

Joined: 2005-03-18
Posts: 62
Posted: Sun, 2007-10-14 08:08

Trying clicking on the WPG2 tab in Wordpress to revalidate, clear your browser cache and give it another go.

---------------------------------------------------
Wordpress / Gallery2 (WPG2) Developer
My Site: http://www.marcnjami.com/

 
kmulh

Joined: 2007-09-20
Posts: 3
Posted: Sun, 2007-10-14 13:42

OK, I gave that a try and still get the same behavior. It's strange as it is only a problem with Image Chooser, all the photos show fine in the Widgets and if I click on one, from the random pictures widget for instance, it takes me right to the gallery with the picture displayed. No login problems at all. I do have the gallery setup so you can't see pictures without registering/logging in, but it wasn't a problem in the past.

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Sun, 2007-10-14 17:54

The backend of the image chooser changed fairly dramatically. Before it was getting its information from the file system, which meant that it did not obey G2 permissions and was not aware of things like G2 replicas and linked items. Now it's getting its info from the G2 database, so it both obeys permissions and knows about all of the different G2 item types, not just ones that are actually in the file system.

I've done some fairly extensive testing on my dev box, and it obeys the permissions of the current Gallery2 cookie. Unfortunately, the user logged into the G2 cookie does not always match the user in the WordPress cookie, because some event has to occur to force the two users to be lined up. An example of that is viewing the site with the sidebar displayed, forcing WP to get data from G2. If you login to the WordPress admin page and go straight to the Write Post page, without ever forcing the G2 cookie to be updated with the current WP user, then G2Image doesn't know that the WP user is logged in because G2Image relies on the G2 cookie for its info, not the WP cookie.

Please try logging in and then viewing the blog while logged in before going to Write Post. If that doesn't work, try going to the embedded page and then to Write Post. Please let me know if that works. If it doesn't, we'll need to do some more troubleshooting.

If it does work, I'll try to make WPG2 3.1 force the cookie syncronization on the Write Post/Page pages.

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website

 
kmulh

Joined: 2007-09-20
Posts: 3
Posted: Sun, 2007-10-14 20:23

Logging in and just viewing the blog didn't seem to help but going to the embedded page did the trick. After I went to the embedded page the image chooser works great. Thanks for the help!

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Sun, 2007-10-14 20:28

Thanks for the feedback. That will actually help me to narrow down what I need to do to make it work automatically in the future.

(And it points out that the sidebar blocks are probably not logging in and obeying permissions...)

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website

 
ClimbingMonkey

Joined: 2005-03-18
Posts: 62
Posted: Sun, 2007-10-14 21:57

As a sidenote I just refreshed all my installs with latest versions of everything and I always set my cookie to "/" in Gallery2. This setting is on the landing page of the gallery administration. Maybe this setting will help...

"When Gallery is embedded in another application (portal, CMS, forum, etc.), then you have the choice between two options. Everyone else does not have to care about the cookie settings. Read on for more details."

---------------------------------------------------
Wordpress / Gallery2 (WPG2) Developer
My Site: http://www.marcnjami.com/

 
AlmostAutomated

Joined: 2007-10-17
Posts: 1
Posted: Thu, 2007-10-18 21:02

capt_kirk,
I just wanted to report that after doing my first install of gallery2 and wpg2 yesterday I had an issue with the g2 icon not being displayed in the default wp editor.

Thank you for your explanation above and the instructions:

Quote:
Please try logging in and then viewing the blog while logged in before going to Write Post. If that doesn't work, try going to the embedded page and then to Write Post. Please let me know if that works.

This happened using wp 2.3 and wpg2 3.0.2 with gallery2 2.2.3 installed in a multisite setup.

Thanks for posting the reason and the work around.

 
scaturan
scaturan's picture

Joined: 2004-09-12
Posts: 1153
Posted: Mon, 2007-10-22 04:44
Quote:
Please try logging in and then viewing the blog while logged in before going to Write Post. If that doesn't work, try going to the embedded page and then to Write Post. Please let me know if that works. If it doesn't, we'll need to do some more troubleshooting.

still unable to resolve the issue reported by "kmulh" - also using WPG2 3.0.2, WordPress 2.3 and Gallery 2.2.3 (multisite)
not sure if this is useful but my setup runs on Apache 2.2.6, PHP 5.2.4 and mySQL 5.0.45

Please advise how I can troubleshoot the problem further, thank you.

_________________
http://photopians.org/

 
camelreef

Joined: 2003-08-10
Posts: 13
Posted: Mon, 2007-10-22 11:53

Hello,

My problem may be a bit different.

I have no album tree in the image chooser.

But if I look at the source, I have all the data in there:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Gallery2 Image Chooser</title>
    <link rel="stylesheet" href="css/g2image.css" type="text/css" />
    <link rel="stylesheet" href="css/dtree.css" type="text/css" />
    <link rel="stylesheet" href="css/lightbox.css" type="text/css" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <script language='javascript' type='text/javascript' src='../../../../wp-includes/js/tinymce/tiny_mce_popup.js'></script>
    <script language="javascript" type="text/javascript" src="jscripts/functions.js"></script>

    <script language="javascript" type="text/javascript" src="jscripts/dtree.js"></script>
    <script language="javascript" type="text/javascript" src="jscripts/prototype.js"></script>
    <script language="javascript" type="text/javascript" src="jscripts/scriptaculous.js?load=effects"></script>
    <script language="javascript" type="text/javascript" src="jscripts/lightbox.js"></script>
</head>

<body id="g2image">

    <form method="post">

        <table>
            <tr>
                <td width="200px" valign="top">
<div class="dtree">
    <p><a href="javascript: d.openAll();">Expand all</a> | <a href="javascript: d.closeAll();">Collapse all</a></p>
    <script type="text/javascript">
        <!--
        d = new dTree("d");
        d.add(0,-1,"KJGN - Gallerie photo","?current_album=7&sortby=orig_time_desc&images_per_page=15");
        d.add(1,0,"Ksénia","?current_album=57470&sortby=orig_time_desc&images_per_page=15");
        d.add(2,1,"Archives 2002","?current_album=60015&sortby=orig_time_desc&images_per_page=15");
        d.add(3,2,"Baptème de Ksénia","?current_album=60023&sortby=orig_time_desc&images_per_page=15");
        d.add(4,1,"Archives 2003","?current_album=60552&sortby=orig_time_desc&images_per_page=15");
        d.add(5,4,"Fisrt Birthday","?current_album=60600&sortby=orig_time_desc&images_per_page=15");
        d.add(6,4,"Dessins","?current_album=61346&sortby=orig_time_desc&images_per_page=15");
        d.add(7,4,"Première plage de Ksénia","?current_album=60944&sortby=orig_time_desc&images_per_page=15");
        d.add(8,4,"Un soir à la piscine","?current_album=62495&sortby=orig_time_desc&images_per_page=15");
        d.add(9,4,"Ksénia le dimanche apres-midi","?current_album=61394&sortby=orig_time_desc&images_per_page=15");

and so on...

what could the issue be?

WP 2.3, G2 2.2.3, WPG2 3.0.2
http://www.youplala.net/

Nico

 
camelreef

Joined: 2003-08-10
Posts: 13
Posted: Mon, 2007-10-22 12:58

[img]http://www.youplala.net/~will/image_chooser.png[/img]

This is what it looks like.

I get the same results whether using Firefox or Opera on Linux.

Nico

 
scaturan
scaturan's picture

Joined: 2004-09-12
Posts: 1153
Posted: Mon, 2007-10-22 13:15

Camelreef, that's exactly what I also see. Internet Explorer reveals a Javascript error, unfortunately, I can't copy and paste the error message to relay it here.
_________________
http://photopians.org/

 
camelreef

Joined: 2003-08-10
Posts: 13
Posted: Mon, 2007-10-22 13:29

ooh... errors in page.

That made me open the Firefox Error Console...

I found this:

Error: unterminated string literal
Source File: http://www.youplala.net/wp-content/plugins/wpg2/g2image/g2image.php?g2ic_tinymce=1
Line: 189, Column: 22
Source Code:
        d.add(162,157,"Presque ici !

and it is related to this:

        d.add(161,157,"28 décembre 2005","?current_album=28601&sortby=orig_time_desc&images_per_page=15");
        d.add(162,157,"Presque ici !
11 Fevrier 2006","?current_album=29101&sortby=orig_time_desc&images_per_page=15");
        d.add(163,157,"14 Fevrier 2006","?current_album=28618&sortby=orig_time_desc&images_per_page=15");

Let me see if I can fix this in Gallery2

OK, I fixed the title of one album, which contained a new line and was not sanitized during the G1 migration.

I have that list properly displayed. :)

That was a nice pointer, thanks!

Nico

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Mon, 2007-10-22 15:13

Nico,

Thanks for the feedback on "newlines" in the album title preventing proper operation of the album tree.

Scaturan,

Could you check your album titles to see if there are any newlines in them?

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website

 
scaturan
scaturan's picture

Joined: 2004-09-12
Posts: 1153
Posted: Mon, 2007-10-22 23:39

capt_kirk: bingo, the resaving the album title did the trick. Thank you!
_________________
http://photopians.org/

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Thu, 2007-10-25 19:45

Great! Glad it worked. For the next version, I'll try to get a regular expression in there that will replace any newlines with spaces.

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website

 
jjoss

Joined: 2008-04-09
Posts: 17
Posted: Wed, 2008-04-09 22:10

Hi everyone,
Here is my first post after many read. Big emotion ;-)
Thank you for all the huge work done here.

My question :

capt_kirk wrote:
Please try logging in and then viewing the blog while logged in before going to Write Post. If that doesn't work, try going to the embedded page and then to Write Post. Please let me know if that works. If it doesn't, we'll need to do some more troubleshooting.

If it does work, I'll try to make WPG2 3.1 force the cookie syncronization on the Write Post/Page pages.

I enconter the problem mentionned upper. Is there any way to solve that problem ? It's a multi-user familly site and the temporary solution is not very user friendly (plz apologize them).

Thx
Josselin
-----------
WPG2 v3.0.2
WP v2.3.1
Gallery version = 2.2.4 noyau 1.2.0.6
PHP version = 5.2.5 cgi-fcgi

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Thu, 2008-04-10 11:16

WPG2 3.05 due for release I hope soon will have a fix for this issue..

____________________________________
Wordpress / Gallery2 (WPG2) Plugin, , WPG2 Documentation, WPG2 Demo

 
jjoss

Joined: 2008-04-09
Posts: 17
Posted: Fri, 2008-04-18 20:52

Thx

Josselin
-----------
WPG2 v3.0.2
WP v2.3.1
Gallery version = 2.2.4 noyau 1.2.0.6
PHP version = 5.2.5 cgi-fcgi