Gallery Module: Gallery2 Integration

Gallery Module: Gallery2 Integration

by Mark Nielsen -
Number of replies: 186
Hello Fellow Moodlers,

I have finished a beta version of the Moodle Gallery Module (MGM), which embeds Gallery2 into Moodle big grin. This module has been developed at Humboldt State University with the guidance of Michael Penney. You can find the code in contrib/gallery. Please refer to the README.txt for installation instructions and to the module's help files for some guidance in using the module.

Major Features:
  • Each MGM instance is linked to its own Gallery2 Album (automatically upon creation). While viewing a MGM instance, it appears as if it has it's own top level (or root) Gallery2 album to which one can add sub-albums, images, comments, etc.
  • When a MGM instance is deleted, so is its linked Gallery2 album and all its content.
  • User Synchronization: Users are created and updated on the fly.
  • Group Synchronization on the fly.
  • Permission Handling: MGM uses Gallery2's permission system to restrict the view of albums. This way, sneaky users cannot peer into albums that belong to other courses wink. Also, permissions for Teachers are set by Moodle admins in the MGM module settings screen and permissions for Students can be set for each MGM instance (the Student default permissions can be set in the MGM settings screen as well). Teachers can only give permissions to students which they themselves have. Example use: Allow students to view the album but not add comments.
  • MGM instances can even be backed-up and restored! The backup procedure copies over Gallery2's album, sub-albums, images, and comments (including all details associated with each item) that are related to a specific MGM instance. Restore will then recreate the before mentioned items to their original, backed-up state into Gallery2; creating a new MGM instance.
To do list:
  • Migrate the Gallery2 bread crumb trail to Moodle's bread crumb trail.
  • Create a Moodle-like theme for Gallery2 (hopefully someone who is talented in theme building can tackle this).
  • And... open to suggestions.
Cheers and Enjoy,
Mark

PS: I'm guessing that you will be able to download the Moodle Gallery Module from here after a nightly build of the contrib files.

Average of ratings: -
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Just H -
Excellent news Mark smile

Was about to post a link on the Gallery2 forum but I guess I don't have to huh . . . seen that pic before!

I have Gallery2 in Moodle at the moment and the integration is what I have been hanging out for. Thanks for your work on this, will give it a try asap.

Regards
H
In reply to Just H

Svar: Re: Gallery Module: Gallery2 Integration

by Anders Berggren -
I wonder if the Moodle community is ever going
to stop stunning you? Amazing contribution!
A million thanks!
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Art Lader -
Thank you so much, Mark. This is terrific news. We will get this up and running before our student exchange this summer.

It is especially helpful that students can upload pics. Just wondering: Can we set it up so that teachers can moderate these uploads to approve or disapprove submissions?

-- Art
In reply to Art Lader

Re: Gallery Module: Gallery2 Integration

by Art Lader -
The Gallery Module must be configured before it can be used.
Please go to Admin → Modules → Gallery Settings to configure the Gallery Module.

Hmmmm... Having trouble finding that path. What would it typically be?

-- Art
In reply to Art Lader

Re: Gallery Module: Gallery2 Integration

by Just H -
Hi Art

Had a bit of a stumble on that one too. Basically it's looking for the relative path from the module to your Gallery install so you have to tell it to go backwards for a bit using ../

For example:

your moodle install is at:
/home/YOURSITE/public_html/training

and you have installed Gallery2 in another directory:
/home/YOURSITE/public_html/connect/gallery2

the gallery module ends up at:
/home/YOURSITE/public_html/training/mod/gallery/

and you have to tell it the relative directory from that location.

So you use ../ to go back a bit first, ending up with:
../../../connect/gallery2

Basically replace the common parts of the url between the two locations with ../

Hope that makes more sense than it looks at this time of the morning having just got back from a birthday party!

Good luck.
H
In reply to Just H

Re: Gallery Module: Gallery2 Integration

by Art Lader -
Thanks, Harry! Get some sleep now...

-- Art
In reply to Art Lader

Re: Gallery Module: Gallery2 Integration

by Just H -
I find sleep is overrated . . . then again, it is 2am so I might just take that advice!

H
In reply to Just H

Re: Gallery Module: Gallery2 Integration

by David Banach -
I had my gallery installation in the root folder of my website so its path was
../../../gallery.

I found I had to rename the folder in the language folder to en (my defaul language) to get it to install correctly.

I get no errors on install and I've set up the module without incident but I get this message whenever I try to add a gallery in a course not matter how many times I run through the gallery settings.

"The Gallery Module must be configured before it can be used.
Please go to Admin → Modules → Gallery Settings to configure the Gallery Module."

Anyone else had this problem?

This is great addition. Many Thanks to the developers.

David






In reply to David Banach

Re: Gallery Module: Gallery2 Integration

by Mark Nielsen -
Hi David,

Did you try the "Check Relative Path ..." button in Gallery Settings?  You are getting that error because the Moodle Gallery Module cannot find Gallery2's embed.php.

Cheers,
Mark
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by David Banach -
Hi Mark,

Thanks for the reply.

Strangely enough I did check the relative path and had it come out correct. I've even tried a new installation of gallery and have tried deleting and reinstalling the module several times.
The setup goes without errors
I still get the same message when I try to add a gallery in a course.



I'll keep trying things. I'm in 1.5.3 BTW.

I can't wait to play with it. I'm already thinking of uses!
David

In reply to David Banach

Re: Gallery Module: Gallery2 Integration

by Mark Nielsen -
Hi again David,

This is very odd. I just tried on a 1.5.3 install and it all worked fine. Perhaps the config variable is not getting set properly.  Try printing out $CFG->gallery_embedpath at the top of your /mod/gallery/mod.html.  Use this to print it:
notify("Gallery embedpath: ".$CFG->gallery_embedpath);
Cheers and good luck,
Mark
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by David Banach -
Hi Mark,

It prints out the directory when I add that line. The relative part seems to be correct, but the dirroot part seems to be strangely missing the slashes to divide the directories.
It prints:
Gallery embedpath: C:dir1wwwrootmoodle/mod/gallery/../../gallery/embed.php

when you would think that

C:\dir1\wwwroot\moodle/mod/gallery/../../gallery/embed.php

would be correct.

The gallery directory is indeed in my moodle directory, and as I said, the path check comes out correct in settings.

I'm afraid I don't know enough PHP to see where this is coming from or even to tell whether it is the problem.

Thanks so much for you help.

David
In reply to David Banach

Re: Gallery Module: Gallery2 Integration

by Mark Nielsen -
Oh!  Well that makes perfect sense wink  The backslashes (\) are removed from the path when it gets stored in the database.  I have a fix for it in CVS, but you will have to wait for the nightly build till you can download it (or just checkout the CVS).

Great reporting David!

Cheers,
Mark
In reply to Mark Nielsen

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Juvenal Sahiri -
Hi Mark,
I have Moodle (version 1.6.3) and Gallery2 installed on localhost (Windows XP) in the following directories:
Moodle:
C:\Apache2\htodocs\moodle
Gallery2:
C:\Apache2\htdocs\gallery2
Gallery module is in:
C:\Apache2\htdocs\moodle\mod\gallery
Path to your Moodle directory, relative to the root of your website: The check path says that it is correct.

But I have a problem with the relative path which I have set as:
../../gallery2
When I click on check relative path, I get:
Path test failed. Could not find Gallery's embed.php
Path used: C:\Apache2\htdocs\moodle/mod/gallery/../../gallery2/embed.php

What should I put? Or which files should I modify to make it work?
Thanks
Juvenal
In reply to Juvenal Sahiri

Re: Gallery Module: Gallery2 Integration

by Juvenal Sahiri -
Mark,
Found what the problem was. I had not counted C:\ as a common element. Once I replaced that with ..\ the check path showed correct.
Juvenal
In reply to Just H

Re: Gallery Module: Gallery2 Integration

by Mark Nielsen -
Hi Harry,

Your example for explaining the relative path module setting is great... so I stole it evil  It is now in the help relative path help file.

Thanks big grin
Mark
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Just H -
No worries . . . maybe I should have a few beers and then have a look at some other modules . . . seemed to clarify my thinking big grin
In reply to Art Lader

Re: Gallery Module: Gallery2 Integration

by Mark Nielsen -
Just wondering: Can we set it up so that teachers can moderate these uploads to approve or disapprove submissions?

This is more of a Gallery2 feature issue.  I'm not sure if Gallery2 has an approval queue, but if it does, that is how you would want to accomplish this.

Cheers,
Mark
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Jim McGowan -
I've installed Gallery2 and the moodle module, both without any problems. However, I can't create any galleries in moodle. When I hit 'Save Changes' on the 'Adding a new Gallery page' I get the following message:

Fatal error: Call to a member function on a non-object in /****/moodle/mod/gallery/locallib.php on line 111

Line 111 in that file is part of the gallery_map_user_to_gallery function. I've tried using a different (moodle) user account to create the gallery, but that gives me the error message:

Fatal error: Call to undefined function: iserror() in /****/moodle/mod/gallery/locallib.php on line 111


Jim
In reply to Jim McGowan

Re: Gallery Module: Gallery2 Integration

by Mark Nielsen -
Hi Jim,

Thanks for the bug report.  This section of the code has caused me a lot of problems angry.  I'll have to do some testing before a solution can be developed.  One question to you though, do any users exist in your Gallery2 database?  If a user with the same user name exists in both databases, then that might cause a problem.  But, like I said, I need to do some more testing on this.

Cheers,
Mark
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Just H -
Hi Mark

Same issue as Jim here.

Only user in my install of Gallery2 is "admin". This is an old install of Gallery2 (as in prior to your module) that I inserted as a resource in Moodle and was waiting for the integration side of things.

If you then go to admin: config: modules it shows the gallery being present (i.e. it says I have 4 now!) although no links on any pages.

Gallery2 and Moodle 1.5.3+ both updated via CVS yesterday.

Hope you manage to figure it out without too much problem.

regards
H


In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Jim McGowan -
Hi Mark,

The Gallery2 database has only 1 user, the admin, which does have the same username as the admin user on my moodle test site, that was what gave me the notion to try to create a gallery in moodle from a different user account.

The Gallery2 (v2.1) install was a fresh install to try with the moodle module. I was trying with a 1.5.2 moodle installation.

Good luck & HTH,

Jim
In reply to Jim McGowan

Re: Gallery Module: Gallery2 Integration

by Mark Nielsen -
Ah-hah!  Sounds like both of you are using the latest version of Gallery2 (2.1 aka Blackjack).  I have not tested the Moodle Gallery Module with this version of Gallery2.  I suspect that it does not work at all sad because of this line in the release announcement: "We've made many changes to the core framework".  I read that and said, "Awe crap!".  The integration between Moodle and Gallery2 is rather extreme (aka, I use a lot of Gallery's core API).  I suspect that something has changed to break this integration.  The error regarding the undefined function isError() is extremely worrisome considering it is a very basic function that I make 38 calls to.  If they changed that, who knows what else they changed sad.

For right now, definitely use the latest of Gallery 2.0.  I currently do not know when or if we are going to support Gallery 2.1 Blackjack mixed.

Cheers,
Mark
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Just H -
Hello again Mark

You beat me to it . . . I was about to ask if you noticed Blackjack was out!

Thing is, I only upgraded to Blackjack this morning. Issue was with the release candidate prior.

H
In reply to Just H

Re: Gallery Module: Gallery2 Integration

by Mark Nielsen -
D'oh... I'll check into it tomorrow, thanks,
Mark
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Penny Leach -
Hi! I have this problem too, I started off with blackjack, but then realised it wasn't compatible, so removed it and went back to unpossible or whatever 2.0.4 is codenamed.

I have a stacktrace of the problem (attached)

HTH.

Penny
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Just H -
Hi Mark

FYI - bit more info on the "Call to a member function isError() on a non-object" error, it kills your backup too (scheduled back up failed for the whole site as did a manual backup I just tried - hangs at the error page).

Later
H
In reply to Jim McGowan

Re: Gallery Module: Gallery2 Integration

by Mark Nielsen -
Hi Jim and Harry,

I'm still thinking that this is an issue with Gallery2.1 Blackjack.  Harry, your CVS checkout is linked to the latest of Gallery2 development branch, which means you get Gallery2.1 code automatically (AKA there is no distinction between Gallery2.0 and 2.1 in CVS).  The main reason why I'm thinking this is because of the undefined function of isError() which I have never gotten in all my coding and debugging experience with this module.  If this problem still exists with a fresh install of Gallery2.0.4 found here, then I'll look into it more.  But right now debugging is almost impossible since Jim has Blackjack and Harry has a CVS version.

The only other problem that I can think of is that files are not getting included correctly in Gallery2 or in the Moodle Module Gallery.  What files system are you both using (like Windows, Unix, etc)?

Hopefully we can get this problem resolved shortly smile, cheers,
Mark


In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Jim McGowan -
Hi Mark,

I'll grab a copy of 2.0.4 and let you know how it goes. My moodle is on an shared linux server from a commercial host. Not sure what the FS on the server is.

Jim
In reply to Jim McGowan

Re: Gallery Module: Gallery2 Integration

by Jim McGowan -
Hi,

I've got gallery 2.0.4 installed now.  I can create galleries OK now, but I can't view them!  I can create a gallery and album from the 'Add an activity' menu, and then upload images.  However, I can't see the image thumbnails in the album after I've uploaded the images. 

Also, once I leave an album after creating it, it cannot reopen it. I can get as far as the page that says ' This is the main page of your Gallery', and lists the album names, but clicking on an album just gets me a 404. sad

Jim
In reply to Jim McGowan

Re: Gallery Module: Gallery2 Integration

by Mark Nielsen -
Hi Jim,

The image thumbnails is a Gallery2 issue.  Do you have GD running in php or some other image processing tool that Gallery2 can use?

For the 404 error, check to make sure that the URL makes sense.  Something in the Moodle Gallery Module's init parameters could be wrong, which could break the urls.  If you can, please post your them.

Cheers,
Mark
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by David Banach -
Hi Mark,

I have the same problem as Jim. After I dowloaded the new version from contrib, I was able to create new galleries, but I get a 404 when I click on the images I add.

The url it looks for is
/moodledir/mod/gallery/v/moodle_1/

which doesn't seem right since usually the url in gallery points to the directory for the gallery installation, while this points to the moodle mod.
When I manually change the url to to /moodledir/moodlegal/v/moodle_1 (the folder of my gallery installation, I get the right type of page, but a permission denied error (since it is set to embed only, I suppose).
I've verified that the image is actually in the storage folder defined within gallery that the v/moodle_1/ is supposed to point to.

Thanks again for all the work on this. It is going to be great to have!

David
In reply to David Banach

Re: Gallery Module: Gallery2 Integration

by Jim McGowan -
My URLs are the same as David's. I know GD is running on the server, as moodle uses it for users' avatars. May be that Gallery2 isn't setup right. I'll look into that (I've actually never used gallery/galler2 before).

Thanks again for your continuing hard work on this Mark.

Jim
In reply to David Banach

Re: Gallery Module: Gallery2 Integration

by Mark Nielsen -
/moodledir/mod/gallery/v/moodle_1/

Oh boy, that is not right at all. An example URL on my machine looks like this (when viewing a picture):

http://mymoodlesite/moodldir/mod/gallery/view.php?id=2&g2_view=core.ShowItem&g2_itemId=15

Hmmm... I wonder if the embedPath is incorrect. I have attempted to generate this on the fly, but perhaps that is a bad call.

You can try this out, find the following code in gallery/locallib.php (around line #55):


function gallery_init($cmid = 0) {
global $CFG, $USER;

require_once($CFG->gallery_embedpath);

$initparams = array('embedUri' => 'view.php?id='.$cmid,
'embedPath' => str_replace('http://'.$_SERVER['HTTP_HOST'], '', $CFG->wwwroot.'/mod/gallery'),
'relativeG2Path' => $CFG->gallery_relativepath,
'loginRedirect' => $CFG->wwwroot.'/login/index.php',
'activeUserId' => $USER->id);

$ret = GalleryEmbed::init($initparams);


Replace the value for embedPath with the following (The following would work with my example URL at the beginning of this post):

'embedPath' => '/moodledir/mod/gallery',

If you like, give that a whirl. Regardless, I'll look into this more tomorrow.

Cheers,
Mark
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by David Banach -
Hi Mark,

I tried the substition and got the same 404 error

When viewing the image I added at the url
http://mysite/moodledir/mod/gallery/v/moodle_3/picture.JPG.html

I get the error

The requested URL /moodledir/mod/gallery/v/moodle_3/picture.JPG.html was not found on this server.


Apache/2.0.54 (Win32) PHP/5.0.4 Server


Thanks again for all your efforts!

David

In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Yew Hong Ng -

Hi Mark, I have a rather similar problem here. I am able to create new galleries as activities, but the gallery2 module generates incorrect urls. For example, The gallery breadcrumb at the top of the gallery page is linked to

http://moodle.mayhemsquare.com/mod/gallery/v/?g2_highlightId=19

my theory is that part of the string was wrongly generated - that /v/?g2 part of the string ought to be /view.php?... I think you would know better where that /v/ thing comes from.

The strange thing is, the links are wrongly created for some urls, but not others. Also, this error only comes up for the installation on my web server - my local installation for testing worked perfectly well.

Hope you can patch these up, this is a really great module for moodle!

In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by J. Chan -

Hello,

I've tried the above change and also I've installed the 2.04 version, I also configured the gallery at admin/module.php?module=gallery. Check path: the message is "Path is correct".

But after I tried to add the activity, the action to start a new album won't start. It got hanged and a blank IE page came up. The URL is http://yourmoodle site/moodle directory/course/mod.php. When until you refresh the IE, it started a moodle page with an error message: No action was specified.

When I go back to the admin/modules.php, I saw that the Gallery has just increased ONE gallery. But I couldn't find the gallery. Now I tried 5 times and I have 5 galleries recorded on the page: admin/modules.php.

Does anyone have the same problem?Have I missed something that I should configure?

I continued to try and use the URL like this: http://yoursite.com/moodle directory/mod/gallery/main.php

I felt relieved at this page: because I can do all the configuration now and installed the gallery 2.

After I went through all the steps: when I start the main.php again:

it comes up with is screen:

Error

An error has occurred.

Back to the Gallery

Error Detail -

Error (ERROR_PERMISSION_DENIED) :
  • in main.php at line 142 (gallerystatus::error)
  • in main.php at line 87
  • in main.php at line 80

line 87:     list($ret, $g2Data) = _GalleryMain($embedded);
line 80:     GalleryMain();
line 142:  return array(GalleryStatus::error(ERROR_PERMISSION_DENIED, __FILE__, __LINE__), null);

Pls give me some hints. Thx.

In reply to J. Chan

Re: Gallery Module: Gallery2 Integration

by Mark Nielsen -
Sounds like you didn't follow the install instructions in the readme.  This could have caused some major problems.

Also, if you changed this line:

$gallery->setConfig('mode.embed.only', false);

to

$gallery->setConfig('mode.embed.only', true);

In your Gallery2's config.php file, then you cannot access your Gallery2 install via main.php, you need to access it via Moodle Gallery Module.

Cheers,
Mark
In reply to J. Chan

Re: Gallery Module: Gallery2 Integration

by Chris West -
I just got the same. Create a gallery and it goes to a blank course/mod.php

Kind of thing that happens when there's code wrong or missing
In reply to Chris West

Re: Gallery Module: Gallery2 Integration

by Chris West -
Stupid me had installed 2.1 instead of 2.0.4

The module now 'works'. However, I can't add any pictures. The album stays empty.
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Mark Nielsen -
Ok, I'm starting to see a pattern here... The problem with the URL's could be a result of a incompatibility between Gallery2.0.4 and PHP5.

David Banach and Harry Smith are running PHP5.  Yew, what version of PHP is running on your web server and on your local install?

David and Harry: can you try testing on PHP4?  If you can, please get back to me.  I'll see if I can do a test on my laptop at home.

Let me know what you all find!

Cheers,
Mark
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Just H -
Hi Mark

Sorry, the real world is still interfering this end (my Moodle install is an unofficial pilot - about to hit the politics very soon methinks!) and haven't had a chance to test it out recently.

I've been trying to track the /v/ down that people have mentioned . . . seen it before, think it was something to do with clean urls if I remember correctly (when I had a quick look at integrating Gallery with Drupal).

Unfortunately, I've just been informed I have to do a show and tell on what I've been doing with Moodle to an EMA (Emergency Management Australia - a national organisation) Training Workgroup forum tomorrow!

Won't get a chance to try it out with PHP4 tonight - nor get any sleep by the looks of it as it's already 1933 hrs over here ("Murphy" is a wonderfull person - my host had a spike on my server and went down for a while there sad )

Will get back to you asap.

Thanks
H
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Tim Allen -
I can also confirm that I am using PHP 5 and Gallery 2.0.4 and am experiencing the same problems.

Unfortunately I don't have access to a PHP 4 server at the moment so I may not be able to test this any time soon. 

Tim.
In reply to Tim Allen

Re: Gallery Module: Gallery2 Integration

by N Hansen -
I thought there were problems in general running Moodle on PHP 5 and that it wasn't recommended, or has something changed?
In reply to N Hansen

Re: Gallery Module: Gallery2 Integration

by Tim Allen -
I am pretty sure that Moodle was declared suitable for PHP 5 some time ago.

Can someone confirm?

Tim.
In reply to Tim Allen

Re: Gallery Module: Gallery2 Integration

by Mark Nielsen -
Hi Tim,

Looks like the /v/ problem is caused when Gallery2 has url_rewrite on.  To turn this off, you may have to access your Gallery2 directly, as in not through Moodle.  For more on this, read further down in this discussion.

Cheers,
Mark
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Yew Hong Ng -

My localhost (which runs everything perfectly) is running on PHP 4.3.10, while my remote host (which is facing problems) is running on PHP 4.4.2. I wonder whether this is useful, but on my remote host, I'm using a subdomain for my moodle hosting. So even though I installed moodle like this:

/public_html/moodle

I access it through this url: moodle.mayhemsquare.com

At first I installed gallery2 like this:

/public_html/gallery2

but realised that this wouldn't work with the way my moodle is accessed, so I installed it like this:

/public_html/moodle/gallery2

Perhaps the rest who are having this problem can comment on this?

In reply to Yew Hong Ng

Re: Gallery Module: Gallery2 Integration

by Mark Nielsen -
Hi Yew,

You may be having a problem with the embed uri setting (I think that's its name).  At work, I have an updated version of the MGM config.html which allows one to set this.  I attempted to find this setting automatically but later I realized that my method would not accommodate all situations.

I'll let you know when that code is in CVS (it's not there now because CVS was down).

Cheers,
Mark
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Yew Hong Ng -

Contrary to my own speculation, I no longer have any problem with this. The url_rewrite thing was the sole cause of the problems. thanks.

In reply to Yew Hong Ng

Re: Gallery Module: Gallery2 Integration

by colin melville -
I must be being incredibly stupid here.

I've installed Moodle 1.5.2 using Fantastico on PHP4.4.1/Linux/Apache platform. I have gallery 2.0.2 installed, again using Fantastico, and working perfectly in freestanding mode, including the generation of thumbnails.

URL rewrite is deactivated.

I've installed MGM, and all appeared to install correctly after changing the en_utf8 folder name to en.

Relative paths checked out according to the 2 buttons in the moodle/mod/gallery/admin page.

I've added a gallery, and this takes me to the admin page with links no images. Initially boxes appear of the correct size for thumbnails. Clicking on these gives 404 error with addresses such as:
The requested URL /mod/gallery/view.php?id=20&g2_view=core.ShowItem&g2_itemId=14&g2_GALLERYSID=521ba493964cd6adcb5e4d5ee3132b87 does not exist.

I've tried turning the embed switch to true and false, but this makes no difference.

Any suggestions? sad


In reply to colin melville

Re: Gallery Module: Gallery2 Integration

by Mark Nielsen -
From what you described, I would try playing around with the second setting on the moodle/mod/gallery/admin page.  The test for it is not very good sad

Let me know if you have any luck!
Mark
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by colin melville -
Mark,

Many thanks indeed! A shift of one directory (../) was all that was needed. The button said there was no such directory, but I tried anyway.

OS, I love it.

Colin

In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Simon Bryan -
I am having the exact same problem, but the ../ doesnt work for me either. I have had to rename the gallery2 folder to gallery to get the url to say ../mod/gallery/... rather than ..../mod/gallery2/.... But that is the only success I have had. The albums work fine in Gallery itself. Also the menu seems very crowded with two text lines and no gaps in between commands.
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Just H -
Hi Mark

That makes sense, although I would've thought they'd run a stable version and a head version for major changes (you might have guessed, I'm on a rather steap learning curve here and have no real idea of coding/scripting or the way people set up repositories!).

Running on a linux server here with PHP 5.1.1 and MySql 4.1.14.

I can email you my phpinfo output if that would be of any use to you.

Will also try it with a Callery2.04 install when I get a chance but the real world has interrupted my play and I have a few publications I need to get out of the way urgently.

Will get back to you asap on the outcome of a new install.

Later
H


In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Matt Campbell -
I've got a very odd problem - I suspect it has something to do with cookies, and it's happened to everyone so far that has tried this in our district.  I set up the gallery module and it works just fine in Firefox, but if anyone tries to view it in IE, it just sits and spins, recording thousands of hits to the log file.

I haven't researched this very much yet - I'll try it from home in the next few days and see if I get the same result.  Here's a snapshot of the log:

Attachment gallery_log.JPG
In reply to Matt Campbell

Re: Gallery Module: Gallery2 Integration

by Matt Campbell -
Missed the time to edit this - I did some browsing in the Apache logs and I get this message 4-5 times a second:

[29/Mar/2006:08:17:38 -0600] "GET /moodle/mod/gallery/view.php?id=4257&g2_
view=core.ShowItem&g2_itemId=15 HTTP/1.1" 200 243 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1)"

So it looks like the website is getting the request and processing it - but IE just comes back with another request.
In reply to Matt Campbell

Re: Gallery Module: Gallery2 Integration

by Yew Hong Ng -
Same here, works with firefox, not with IE6. After creating a new gallery from moodle, the page just keep "clicking" trying to access some page but never able to get to that page.
In reply to Matt Campbell

Re: Gallery Module: Gallery2 Integration

by Yew Hong Ng -

The problem is with the $_SERVER['HTTP_REFERER'] codes. I'm not an experienced php programmer, so i dun really know why firefox and IE process these differently but i sort of got rid of the problem by adding

!$g2_view &&

to the 1st if condition. ie.

if (!$g2_view && !empty($instance->albumid) and ($_SERVER['HTTP_REFERER'] ...
In reply to Yew Hong Ng

Re: Gallery Module: Gallery2 Integration

by Matt Campbell -
Thanks!  I added your snippet and IE is working fine, now.
In reply to Yew Hong Ng

Re: Gallery Module: Gallery2 Integration

by Mark Nielsen -
Hi Yew,

I added this to the gallery module code.  Thanks for your help.  The CVS version of the code will be updated once CVS is back on-line.

Cheers,
Mark
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Just H -
Hi Mark

Finally getting a chance to try again!

OK:
  • brand new install of Moodle - Moodle 1.6 Beta 1 (2006032900)
  • running php 4.4.1
  • install Gallery 2.04
  • drop gallery module into mod folder and go to Admin - success for setting up tables but get the following error twice "Warning: Invalid argument supplied for foreach() in /home/emanage/public_html/mod/gallery/lib.php on line 431" (if I remember correctly got that on the first install too)
  • hit continue and set up the module OK
  • add first MGM, back out and then in again, click on an album and get "The requested URL /mod/gallery/v/moodle_1/ was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."
  • went to Gallery2 admin and as I thought, the /v/ is because URL rewrites is defaulted to activated - deactivate it and you get rid of the above error and all looks good, but. . .
Still issues with thumbnails not showing and a " The requested URL /mod/gallery/admin/ was not found on this server." and a 404 when I clicked on site admin (would've thought site admin should be heading to Gallery2 not the mod?).

It's 2:14 am so I'm going to have to hit the hay but will get back to it when I can. At least we know where the /v/ is coming from and I'll flick this install to php 5 when I get back to it to see if we can eliminate that from the equation too.

hope you're still having fun! wink

H



In reply to Just H

Re: Gallery Module: Gallery2 Integration

by Yew Hong Ng -
yes! the url_rewrite thing solved my problem. So my installation is now running perfectly! Thanks to you for this post and Mark for this brilliant mod!
In reply to Yew Hong Ng

Re: Gallery Module: Gallery2 Integration

by Just H -
Hi Yew

Good to hear smile

So you're not having any problems with thumbnails or Gallery2 site admin link?

H
In reply to Just H

Re: Gallery Module: Gallery2 Integration

by Yew Hong Ng -
By your post, i assume you have problems with the admin link only when the albums are nested? I tried creating an album within an album to try this, no problem, link works fine soon as i changed the url_rewrite thing. my thumbnails are all fine.
In reply to Yew Hong Ng

Re: Gallery Module: Gallery2 Integration

by Just H -
hi Yew

Don't suppose you want to swap sites do you? wink

Still problems with thumbnails here and the admin link issue is from all occurences (just created a sub album in an album in the main Gallery).

Probably something I did wrong during install, was early morning when I started looking at it again, never a good idea trying to trouble shoot when you're falling asleep!

Sure it'll be figured out eventually.

Your success shows there is light at the end of the tunnel smile

H
In reply to Yew Hong Ng

Re: Gallery Module: Gallery2 Integration

by Mark Nielsen -
Of course, url_rewrite could cause the urls to look like that!!! Fantastic!

So, new requirement for the MGM install: url_rewrite in Gallery2 must be turned off or you will get odd urls like this:

/moodledir/mod/gallery/v/moodle_1/

Which MGM does not know how to interpret resulting in a 404 error (or some other error).

Cheers,
Mark
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Just H -
Hi Mark

PHP5 doesn't appear to affect it, just flicked it over and no new issues as far as I can see so far.

Still having problems with thumbnails (see image below) but strangely enough, having problems if I go to Gallery direct (again, see below - sometimes thumbnail appears sometimes it doesn't?). Don't see why it should be affected from the standalone install - maybe a Gallery issue?

As mentioned above, when I hit the Gallery site admin link in an embedded Gallery it tries to link to "mod/gallery/admin/" rather than "gallery2/admin/" don't see how that would work unless part of your magic is replicating the admin side of things within the module (I really need to find time to get my head round this php/mysql/ruby/rails/ajax and even html stuff sad )

Also, as can be seen below, the module seems to be effecting the font sizes in various places.

Looks like we're getting there though smile

Slightly off-topic, your integration is going the whole hog as in full-on integration into Moodle (and mighty glad we all are smile ). At the moment, this is over and above what I need for my specific situation on a couple of sites. Would you by any chance have a snippet of code laying around, or could cut and paste from your module, that allows single sign-on?

The sites I have in mind basically just want one Gallery on the home page that acts as a repository for pics etc. for the whole membership (I just added it as a resource) therefore, the backup side of things will be handled by Gallery. My struggle so far is the single sign-on side of things to make it look seamless (I really really really need to figure out this scripting stuff!).

H

Attachment gallery2.jpg
In reply to Just H

Re: Gallery Module: Gallery2 Integration

by David Banach -
I can confirm that changing the url settings within Gallery 2 fixes the problems even for PHP 5.

My thumbnails work fine now, and I don't have a problem accessing the admin page from within moodle.

I also changed the cookie settings for embedding within the Gallery 2 general site admin page, and I haven't turned the embed only setting back on in my gallery 2 config file, but I don' know if either of these make a difference.

My installation seems to work fine now, as far as I can see.

Thanks!!!!



In reply to Just H

Re: Gallery Module: Gallery2 Integration

by Mark Nielsen -
Hi Harry,

Still having problems with thumbnails...

Go to your Gallery2 admin screen and check the tools under Graphics Toolkits (I only have GD).  Each toolkit will show you their supported image file types.  Here are GD's:
  • image/gif
  • image/jpeg
  • image/png
  • image/vnd.wap.wbmp
So, if you upload an file that is not one of those, then you will not get a thumbnail because it cannot be processed.

"mod/gallery/admin/" rather than "gallery2/admin/"

It shouldn't link to either of those.  The first one looks like a url_rewrite and the second would go to the non-embedded Gallery2.

My struggle so far is the single sign-on side of things to make it look seamless (I really really really need to figure out this scripting stuff!).

SSO sounds cool.  The snippet that you would be interested in is in mod/gallery/locallib.php and the function is called gallery_init().  You could try this:

require_once($CFG->dirroot.'/mod/gallery/locallib.php');
gallery_init();
redirect('http://urltoyourgallery2.com');

BUT, I think the init params may be incorrect if you do this from another directory other than mod/gallery/

If that is the case, then you need to do the same snippet as above, but instead of gallery_init(); copy paste the contents of gallery_init function in between the require and the redirect and modify the init params.  Good Luck!

Cheers,
Mark
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Mark Nielsen -
Another thought on this is to create a block that would do SSO and link to your gallery install...  Just thinking out loud.
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Just H -
Hi Mark

Thumbnails issue: Yep got GD, ImageMagick and NetPBM (just need to compile ffmpeg on the server now!) so doubt it's a filter issue. Was thinking maybe something to do with the error I got on install?

"Warning: Invalid argument supplied for foreach() in /home/emanage/public_html/mod/gallery/lib.php on line 431"

Might have to start from scratch when I get a chance and see if I can install without getting that error.

Site admin: Hmmmm, will pay more attention on second install!

SSO: thanks for the tip (and the subsequent one) will see what I can do when I get a chance. Things would be so much easier if our Moodle was official rather than doing stuff at night after work or stealing a quick 5 minutes during the day!

Main thing is, your excellent mod is working for others so there is light at the end of the tunnel for me smile

Later
H
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Mark Nielsen -
Minor Update to MGM:
  • Updated the README to say that only Gallery2.0.4 is supported and that url_rewrite needs to be turned off.
  • The fix for the IE refresh loop.
  • New config for URI embed path.
If you upgrade, you will have to update your config settings in Moodle Admin -> Modules -> MGM Settings.

Cheers,
Mark
In reply to Mark Nielsen

Gallery2 Integration: A Few minor problems

by David Banach -
I just got the gallery module (version 2005091600) running in 1.6.1 without problems. I'm really appreciative of the work you did on this great module. The galleries work just fine.

I've run into just a few problems:
1. When I click on the list of galleries for a course in the activities block I get this error:     A required parameter was missing
Debug gives
Notice: Undefined variable: id in /moodledir/mod/gallery/index.php on line 17
 
 2. When I backup a gallery in one course in order make a copy in another, the gallery copies but is empty (no subgalleries or iamges from the original)  when restored in the new course. I did do backup without user data, if that makes a difference.

3. When I tried to use the java full  screen slideshow applet (one of my favorite parts of gallery) I get an error saying there is no active remote module at the gallery http address and asking that I check that there is an active gallery installation at the address. I changed the embed only setting to false in the config.php file in gallery, and the java slideshow worked. Is it ok to leave the embed only setting off?


Thanks for any help you can give me on these little annoyances!

David







In reply to David Banach

Re: Gallery2 Integration: A Few minor problems

by William Lu -
Picture of Particularly helpful Moodlers

Yes, I had same problem. The ‘Galleries’link (in the moodle nav bar) was wrong.

I've been watching here and no one came to answer yousad.

So, I just redirect to the Gallery mainpage by:

  1. Do NOT Edit your Gallery 2 config.php file to make any embed.
  2. Delete all content in mod/gallery/index.php and replace with:

<?php

echo'<meta http-equiv="refresh" content="0;url=http://yoursite/gallery/main.php">';

?>

It lost the list of galleries and doesn’t display that annoying error msg.

But, I am still looking forwards to seeing  someone fix that problem.

In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Will Taylor -
THANK YOU !!!!
Got this up & running smoothly without a hitch (using the version in CVS, in moodle 1.5.3)
I cannot tell you how excited I am about this integration.
- will
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration - separate galleries

by Will Taylor -
A question -

If several galleries are set up, it is possible from the left-block Gallery menu to access all of these from any one gallery; even if these are set up in different courses.  This could be confusing with Galleries that are intended to be course-specific.

Is it possible to remove the Gallery menu, so that the user is committed to the one Gallery they enter from any single activity link?

thanks,
will
In reply to Will Taylor

Re: Gallery Module: Gallery2 Integration - separate galleries

by Will Taylor -
Well, guess I should have waited a few minutes to ask ... just delete the menu in the Gallery theme editor.
In reply to Will Taylor

Re: Gallery Module: Gallery2 Integration - separate galleries

by Geoffrey Rowland -
Picture of Plugin developers
A huge thanks to Mark Nielson and the rest of the Gallery (MGM) developers and troubleshooters. Just installed this in Moodle 1.5.3+ and PHP4 (probably the last thing I'll do before the 1.6 upgrade) and all seems to be working without a hitch big grin.

I'm sure this will have a major role in 'converting ' erstwhile Moodle-suspicious art, photography and media teachers wink.

With it's sophisticated permissions system, and the ability to add text and comments, it strikes me that this is not just a 'photo gallery' but has many of the characteristics of a Moodle (Digital Image) Repository. It also has great potential as a Showcase or e-Portfolio for students' work. So at the very least, this will be a useful stand-in until other Repository/Portfolio solutions mature, or we can afford to buy-in Hive.

Keep up the good work!
In reply to Geoffrey Rowland

Re: Gallery Module: Gallery2 Integration - Backup Problems

by Geoffrey Rowland -
Picture of Plugin developers

Hi again

As indicated in my posting yesterday, all seems to be working well with our MGM intall...

... apart from Moodle backups sad.

Our automated (weekly) backup is unfinished/fails on courses which contain Galleries. Manual backup of these courses also fails at the point of Gallery backup, but succeeds if the Gallery is excluded.

Any ideas?

Thanks

In reply to Geoffrey Rowland

Re: Gallery Module: Gallery2 Integration - Backup Problems

by Geoffrey Rowland -
Picture of Plugin developers
To answer my own question on Gallery backups
RTFM (read the flipping manual wink)
The README.txt file has the line:

2.  Install Moodle 1.5 or greater (1.6 or greater for backup/restore I think).

So presumably the upgrade to Moodle 1.6 will sort the backup problem!
In reply to Mark Nielsen

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

Re: Gallery Module: Gallery2 Integration

by Mark Nielsen -
The second problem was with the relative url.

Did you try just a single /  ?

Cheers,
Mark
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Peter Ghosh -

Yes.  That doesn't seem to work either.  The links for the stylesheet don't contain the server name.  See below:

<!-- Gallery Header Info --> 
<link rel="stylesheet" type="text/css" href="http://gallery2/modules/icons/iconpacks/paularmstrongdesigns/icons.css"/>
<link rel="stylesheet" type="text/css" href="http://gallery2/themes/matrix/theme.css"/>
 <!-- End Gallery Info -->

They should be:
http://wsmoodle/gallery2/modules/icons/iconpacks/paularmstrongdesigns/icons.css
and

http://wsmoodle/gallery2/themes/matrix/theme.css
respectively
.

-Peter

In reply to Peter Ghosh

Re: Gallery Module: Gallery2 Integration

by Mark Nielsen -
Hi Peter,

How is your site http://wsmoodle?  Shouldn't there be a .com, .org, or .something at the end?

Cheers,
Mark
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Peter Ghosh -

Mark,

Thanks for getting back to me.  Moodle is set up as an internal installation only.  We are a residential school in Inida (www.woodstock.ac.in) and are deploying Moodle only for use within the campus network.   I've attached the info page here for details of our set up.  In my previous post I had attached the html file that contained the broken links to the style sheets.  As far as I can tell all the other functions of Gallery work fine but the pictures don't display beacuse they're missing the server name as well.

Thanks for your help.

-Peter

In reply to Peter Ghosh

Re: Gallery Module: Gallery2 Integration

by Mark Nielsen -
Hi Peter,

Could you please provide a link to your Moodle install (or send it through Moodle's message system if you don't want to post it)?

Thanks,
Mark
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Peter Ghosh -

Hi Mark,

Our Moodle deployment is an intranet only deployment which is not accessible from the outside.  Is there any other information I can provide you with to help me fix this problem?

Thanks,
Peter

In reply to Peter Ghosh

Re: Gallery Module: Gallery2 Integration

by Mark Nielsen -
Hi Peter,

I don't have to actually visit it, but the link tells me a little of how Moodle is set up.

Cheers,
Mark
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Peter Ghosh -

Hi Mark,

The link is http://wsmoodle (which wont work from anywhere but inside the intra net)  I have "wsmoodle" set up as a alias for one of the ip address of the server that moodle is installed on.  In IIS moodle is set up as a separate web site with the same ip as the alias.

Thanks,
Peter

In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Peter Ghosh -

Hi Mark,

So I suspect that the problem might be in GalleryEmbeded:parseHead.  Can you tell by looking at it if it parses the "css" list correctly if there is no "." in the name.  My regex is very rusty.

Thanks,

Peter

 

/**

* Parse html (headHtml) for css links, javascript and page title

*

* @param string headHtml

* @return array(string title, array (string css1, string css2, ...),

* array (string javascript1, string javascript2, ...))

* @static

*/

function parseHead($headhtml) {

$title = '';

$css = array();

$javascript = array();

/* Only one title allowed */

if (preg_match("|<title(?:\s[^>]*)?>(.*)</title>|Usi", $headhtml, $regs)) {

$title = $regs[1];

}

/* More than one script section allowed */

if (preg_match_all(

"|<script(?:\s[^>]*)?(?:\ssrc=[\"\'].+[\"\'])?(?:\s[^>]*)?>.*</script>|Usi",

$headhtml, $regs, PREG_PATTERN_ORDER)) {

foreach ($regs[0] as $script) {

$javascript[] = $script;

}

}

/* More than one style allowed */

if (preg_match_all("/<link .*\/>|<style(?:\s[^>]*)?>.*<\/style>/Usi",

$headhtml, $regs, PREG_PATTERN_ORDER)) {

foreach ($regs[0] as $style) {

$css[] = $style;

}

}

return array($title, $css, $javascript);

}

In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Thierry Launay -
I've managed to install the mod but my Moodle installation is in french and all the strings appears like string, not the real text.

I'm not familiar with the process of translating Moodle modules and my first guess was not good : I've copied the en_utf8 folder inside the lang one and renamed if to fr_utf8. I hoped to see the strings in english and then edit the gallery.php and help files to translate all, but the strings stuff continue to show up... I'm missing something but I can't figure what ?
In reply to Thierry Launay

Re: Gallery Module: Gallery2 Integration

by Jean FRUITET -

This is a french translation of Moodle Gallery Module.
Copy it to moodledata/lang/fr_utf8.

To get french in Gallery2 embedded parts of the application, you have also to set Gallery2 general parameters to french smile

 

In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Peter James -
I have managed to install the gallery module and after much um ming and ah hing and the reading help file found that i had to go back up two stages of the directory tree using ../../ and then go into the gallery2 directory so my path looked like this ../../gallery2, for the other path i just entered my web address and that was accepted.
However my next problem was that i got an error
Fatal error: Call to a member function isError() on a non-object in //mod/gallery/locallib.php on line 111
looking into this error it is where the database is not linking. I then found this post
http://moodle.org/mod/forum/discuss.php?d=31755 with a file called moodle-gallery.zip, this contains some files that when a new user is created in moodle the same user is created in the database for gallery2. This works as i have checked my gallery2 database for the added entry. But now i get the error

Fatal error: Call to a member function getErrorCode() on a non-object in mod/gallery/locallib.php on line 63

I have this site hosted for me with this environment
database mysql version 4.1.16 is required and you are running 4.1.19 OK
php
version 4.3.0 is required and you are running 5.0.4 OK
php_extension iconv is recommended to be installed/enabled OK
php_extension mbstring is recommended to be installed/enabled OK

I also have a test site stand alone on my laptop and the gallery works with no problems and allows me to create albums and add pictures. The environment for my laptop is this.
database mysql version 4.1.16 is required and you are running 5.0.22 OK
php
version 4.3.0 is required and you are running 4.3.10 OK
php_extension iconv is recommended to be installed/enabled OK
php_extension mbstring is recommended to be installed/enabled OK

Both my versions ar 1.6.
If anybody has any clues why i am getting these errors it would be of great help.

cool
In reply to Peter James

Re: Gallery Module: Gallery2 Integration

by Peter James -

I have managed to make it work not sure how, but I think it was because I made the gallery table part of the moodle table and using the files from the zip in my previous post it created a user in both parts. I then made a gallery using the newly made user that went OK and then I made one as myself and everything looks OK.

If i can be of any help to anyone by looking at my installation let me know

Peter James

In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Bernard Davis -

We're running the latest versions of PHP 5 and MySQL.  We've just migrated to Moodle 1.6, specifically because we needed Gallery, I downloaded the 'Unpossible' version and installed it yesterday (definately NOT the 'Blackjack' version)and I cannot get it to work properly.

Gallery itself works fine as a standalone.

When I add Gallery as a module to Moodle and then add it as an activity to a course it almost works fine.  I can create albums and upload files, these files can be viewed within Gallery2, so I know that it is working at that end and that the files are being uploaded and processed.

However in Moodle I simply get the broken graphic symbol instead of the image, this applies both to the thumbnail and to the image itself.

An example <img> tag, might look like this:

<img src="http://www.kgv.ac.uk/kgv/gallery2/main.php?g2_view=core.DownloadItem&g2_itemId=22&g2_serialNumber=2&g2_GALLERYSID=e26f0acb0cf2f9a88193681ac0ebf77b" width="640" height="221" alt="RA_Flight800" longdesc="Red Arrows"/>

I've seen reference in the posts above to disabling url_rewrite, could this help, and if so where would I find the code to do it?

Regards,

Bernard D

In reply to Bernard Davis

Re: Gallery Module: Gallery2 Integration

by Bernard Davis -

Apparently url_rewrite is a Unix function,  we're definately on Windows, it didn't make any difference when I uninstalled it anyway.

Can someone give me a clue please?

Bernard D

In reply to Bernard Davis

Re: Gallery Module: Gallery2 Integration

by David Banach -
Bernard,

I definitely had to disable url rewrite to get it to work. You do this in the administration page (Site Admin) within Gallery. You don't alter the apache settings themselves. Go to modules and click on deactivate under url rewrite.

Good luck!

David
In reply to David Banach

Re: Gallery Module: Gallery2 Integration

by Bernard Davis -

Hi David,

Thanks for that.  I actually did that, although it clearly said "In order for this Gallery module to work you need mod_rewrite enabled with your Apache server."  We're not using Apache.

When I tried the test link I got the message "FAIL_NO_REWRITE"

It made no difference.  I've currently got it Uninstalled, but no luck.

Cheers

In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by ztechguy Z -
I have tried the installation of gallery2 in my moodle 1.6 installation and I can get the mod installed correctly, and the paths seem correct for the moodle directory and the gallery directory.  But when I go to add a gallery I fill out the first page forms, ie name, description, and so on, and hit save and it sends me to a blank screen.....  Any ideas....

ztechguy
In reply to ztechguy Z

Re: Gallery Module: Gallery2 Integration

by Mark Nielsen -
Hi,

Does it create anything in the course?  If you don't have debugging on then you might want to try turning that on to see if there are any errors.  It is difficult to help because I have never run into this problem before smile

Cheers,
Mark
In reply to ztechguy Z

Re: Gallery Module: Gallery2 Integration

by Stuart Tannehill -

Same problem here. The paths are, without a doubt, correct. In my apache error log I see this:

PHP Fatal error: Call to a member function isError() on a non-object in /Library/WebServer/Documents/moodle/mod/gallery/locallib.php on line 111

Line 111 is this:

109 // Get the G2 user that matches the Moodle username
110 list ($ret, $g2user) = GalleryCoreApi::fetchUserByUsername($user->username);
111 if ($ret->isError() and !($ret->getErrorCode() & ERROR_MISSING_OBJECT)) {
112 error('Gallery Core Error'); // something is wrong besides user mapping
113 }

So... do I need to create a user in Gallery and a user in Moodle that use the same username? Or is the module supposed to take care of that and not doing it? Any ideas?
edit-> Oh... debugging gives me nothing and nothing is created in the course. It is as if I have done nothing at all.

In reply to ztechguy Z

回應: Re: Gallery Module: Gallery2 Integration

by lin lis -

I hve the same situation.

Does anyone know how to correct it?

In reply to lin lis

回應: Re: Gallery Module: Gallery2 Integration

by lin lis -

I change gallery2.1 to gallery2.04

and it work correctlly

In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Jon Lloyd -
I am working with version 1.5.3 and have installed Gallery but get this message.. Warning: Invalid argument supplied for foreach() in /home/www/wildwatc/moodle/mod/gallery/lib.php on line 435. The readme file says 1.5.3 or later eg 1.6 to sort out backup issues. Any ideas what might have gone wrong. Thanks.
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Simon Bryan -
Hi Mark,
Great Module, I finally sorted the Relative Path and have it up and running but only for ADMIN, everyone else gets:
Could not add proper gallery permission.

Error (ERROR_MISSING_OBJECT) : ParentSequence for 26461
  • in modules/core/classes/helpers/GalleryItemAttributesHelper_medium.class at line 145 (gallerystatus::error)
  • in modules/core/classes/GalleryCoreApi.class at line 1296 (galleryitemattributeshelper_medium::fetchparentsequence)
  • in modules/core/classes/helpers/GalleryPermissionHelper_advanced.class at line 218 (gallerycoreapi::fetchparentsequence)
  • in modules/core/classes/helpers/GalleryPermissionHelper_advanced.class at line 80 (gallerypermissionhelper_advanced::_changepermission)
  • in modules/core/classes/GalleryCoreApi.class at line 671 (gallerypermissionhelper_advanced::addgrouppermission)
  • in /var/www/html/mod/gallery/locallib.php at line 435 (gallerycoreapi::addgrouppermission)
  • in /var/www/html/mod/gallery/view.php at line 101

I have removed all the default permissions in the Module settings, in Gallery the usersa re bing created, and Group Everybody hs rights to view all objects.

ANy ideas?

(PS I found a way to import to Gallery2 from a remote Gallery1 server, which the Gallery site said you could not do - I simply mounted the Gallery1 server into the Gallery2 server webroot directory using NFS and treated it as a local one.)
In reply to Simon Bryan

Re: Gallery Module: Gallery2 Integration

by J. Chan -

Hello everyone,

I installed a new moodle 1.6+ successfully  three days ago. And, I finally installed the Gallery and the Gallery Module since my first try in April this year.

The gallery worked on standalone, i.e. from http://mydomain.com/gallery

It also worked in Moodle when I added an album as activities. The teacher or admin mode worked fine.

However, when my student logged in, they could not open the album, instead they got the following message:

 The first time:

Gallery User creation failed
Error (ERROR_STORAGE_FAILURE)
in modules/core/classes/GalleryStorage/DatabaseStorage.class at line 1238 (GalleryStatus::error)
in modules/core/classes/GalleryStorage.class at line 294 (DatabaseStorage::addMapEntry)
in modules/core/classes/interfaces/ExternalIdMap.inc at line 96 (GalleryStorage::addMapEntry)
in modules/core/classes/GalleryEmbed.class at line 311 (ExternalIdMap::addMapEntry)
in /home/user/public_html/moodle/mod/gallery/locallib.php at line 130 (GalleryEmbed::createUser)
in /home/user/public_html/moodle/mod/gallery/locallib.php at line 65
in /home/user/public_html/moodle/mod/gallery/view.php at line 95

The second time they tried to open the album activity, they have this message:

User mapping failed twice

Error (ERROR_MISSING_OBJECT) : Missing object for 26
in modules/core/classes/GalleryStorage/DatabaseStorage.class at line 2121 (GalleryStatus::error)
in modules/core/classes/GalleryStorage/DatabaseStorage.class at line 305 (DatabaseStorage::_identifyEntities)
in modules/core/classes/GalleryStorage.class at line 118 (DatabaseStorage::loadEntities)
in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 82 (GalleryStorage::loadEntities)
in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 141 (GalleryEntityHelper_simple::loadEntitiesById)
in modules/core/classes/GalleryCoreApi.class at line 2225 (GalleryEntityHelper_simple::loadEntityByExternalId)
in modules/core/classes/GalleryEmbed.class at line 184 (GalleryCoreApi::loadEntityByExternalId)
in modules/core/classes/GalleryEmbed.class at line 94 (GalleryEmbed::checkActiveUser)
in /home/user/public_html/moodle/mod/gallery/locallib.php at line 68 (GalleryEmbed::init)
in /home/user/public_html/moodle/mod/gallery/view.php at line 95

Any idea?

Cheers

James

In reply to Simon Bryan

Re: Gallery Module: Gallery2 Integration

by Diane Harman-Hoog -
I installed Gallery from the download in the subdirectory /courses which is where moodle is. I then moved the files as directed to the mod directory.
I followed the readme file and set the paths and it asked me about permissions. I answered yes to question about having moodle handle permissions. Then the next line says Default User Permissions: with nothing after that point on the page no way to Submit the information or any thing.

When I go to administrator interface for moodle there is no entry for galley under activities.

I also did the following as directed in the Readme file:

**Edit your Gallery2's config.php file and make the following edit:
Change:
$gallery->setConfig('mode.embed.only', false);
To:
$gallery->setConfig('mode.embed.only', true);

This will make Gallery2 only accessible through embedded applications (aka MGM).**

Am I missing something?

Thanks, I have a definite time frame crunch on getting this up and working.

Diane
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Lyubomir Zhivkov -
Hi Everyone,

Unfortunately there was a Problem yesterday, when I tried to install Gallery2 on Moodle. I've tried to inegrate Gallery2 in a new Moodle Installation (1.6.1+, not just 1.6.1) and it didn't work good.
The gallery didn't open in the own frame but in the moodle frame  and everything -fonts and styles were those from moodle, so that the admin menu of the gallery was with VERY big letters. I've tried to create an album, I've uploaded some photos successfully, but the photos didn't show up...

Has anybody an good Idea? Is the problem i the newer Moodle version? Should I install the 1.6.1 again?

Thanks - LZ
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Frank Thiel -
Hi Mark,
thank you very much for the Gallery module. How can I modify the scripts  , so that Menue and Navigation Fonts appears larger  ?
Frank
In reply to Frank Thiel

Re: Gallery Module: Gallery2 Integration

by Herman A. Junge -
Hi Frank,

   Just get into the /themes directory where gallery is installed. You will find there is a folder called matrix, this is the default theme of Gallery. Inside this /themes/matrix folder is the file theme.css. Open it and edit the type font-size to 100% inside the class #gallery. You can't miss it, because is the only font-size tith a percentage. That will do.

HAJ.-

BTW, I never write in english, so I ask you to excuse my grammar. Any question, feel free to mail me.
In reply to Mark Nielsen

How to add a place for users to submit/upload photos

by jonny guns -
Hello, I was wondering if there is a way to ad a place for logged in users the ability to upload and submit a photo to me. I wanted to the photo to not be instantly published but either emailed to me with the description the user put or placed into some sort of que that when approved it would go live or be published. Is this possible?
I want the to offer my users a way to sumbit a "picture of the day contest" so I will review all submissions and I will choose one. the rest will be just placed into the proper category the user specified. ie. trucks, cars, boats ect..

Get it? Please email me or reply if you know how I can do this.. Even Placing it on the main page would work..

thanks
In reply to jonny guns

Re: How to add a place for users to submit/upload photos

by Michael Penney -
The data module in 1.6 should work, users can upload photos and they can be set to use an approval queue (not visible until approved).
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Dirk Grunwald -
I'm having a problems with paths & wondering if someone can help.

I have a site http://moodle.cs.colorado.edu

On the linux end, I have /var/www/html/moodle point to the current release
(which is moodle-1.6.2, with a security patch)

I installed gallery2.0.4 in /var/www/html/gallery2 and put a symlink into /var/www/html/moodle/gallery2 so that I could run the installation

After doing the install, I could visit the gallery2 area directly and I could create albums. I can also upload photos etc.

However, the CSS for the album attempts to load

 <!-- Gallery Header Info --> 

<link rel="stylesheet" type="text/css" href="http://gallery2/modules/icons/iconpacks/paularmstrongdesigns/icons.css"/>

i.e. it's not including the host name.

I can modify modules/core/classes/GalleryUrlGenerator.class

to eliminate that by removing the $domain part of the sprintf in makeUrl
but that breaks other things in different ways.

I'm assuming I'm doing something silly here, but I can't seem to figure out what.
Any suggestions?
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Priya Saini -

Hi All,

I managed to install and integrate gallery2 and moodle's gallery module successfully on my localhost but while trying to replicate the same process online..i am facing few issues..

Standalone gallery is working fine. But when using inside moodle it shows the following errors..

When i try to add a gallery:

An error has occurred.
Back to the Gallery

Error Detail -

Error (ERROR_MISSING_OBJECT) : Missing object for 53
  • in modules/core/classes/GalleryStorage/DatabaseStorage.class at line 2121 (GalleryStatus::error)
  • in modules/core/classes/GalleryStorage/DatabaseStorage.class at line 305 (DatabaseStorage::_identifyEntities)
  • in modules/core/classes/GalleryStorage.class at line 118 (DatabaseStorage::loadEntities)
  • in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 82 (GalleryStorage::loadEntities)
  • in modules/core/classes/GalleryCoreApi.class at line 2186 (GalleryEntityHelper_simple::loadEntitiesById)
  • in modules/core/classes/GalleryView.class at line 361 (GalleryCoreApi::loadEntitiesById)
  • in modules/core/classes/GalleryView.class at line 219 (GalleryView::_getItem)
  • in main.php at line 287 (GalleryView::doLoadTemplate)
  • in main.php at line 87
  • in modules/core/classes/GalleryEmbed.class at line 153
  • in /home/c32ndnda/public_html/main/mod/gallery/view.php at line 106 (GalleryEmbed::handleRequest)

when i try to access the photos that are added directly to the gallery, from inside the moodle.. i see a difference.

On localhost the link to a photo is something like
http://localhost/moodle_new/mod/gallery/view.php?id=1&g2_view=core.ShowItem&g2_itemId=29

but online it is:
http://www.32ndnda.com/main/mod/gallery/v/DSC00013.JPG.html

My installation procedure is all the same at both places.. Please suggest me the solution to this issue..

TIA,
Priya Saini

In reply to Priya Saini

Re: Gallery Module: Gallery2 Integration

by Will Cunningham -
I have the gallery up and running but with a couple of issues.

The gallery appears to be working fine from with moodle but I can't delete the gallery instance or edit/update it from within moodle. If I hit the edit button or if I am in the gallery withing moodle and hit the update this gallery button I get this

Fatal error: Call to a member function on a non-object in yadda/yadda/yadda/mod/gallery/mod.html on line 41

Any suggestions
In reply to Will Cunningham

Re: Gallery Module: Gallery2 Integration

by Juan Loyola -
Please I need help. Using admin account I can use the module without problems. But if a student browse to the gallery he gets:

Fatal error: Call to a member function on a non-object in c:\.....\moodle\mod\gallery\locallib.php on line 270


In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by David Jackson -
We are receiving a 404 error if the user is not logged into moodle when accessing galleries. When we first set everything up we got it working by linking to the galleries and adding '&username=guest' to the end of the URLs, but for some reason this no longer works.

Has anyone else experienced this problem with annonymous access?

Gallery version = 2.0-rc-2 core 0.9.36
PHP version = 5.1.4 cgi-fcgi
Webserver = Microsoft-IIS/5.0
Database = mysql 4.1.20-community-nt
Toolkits = Exif, Gd
Operating system = Windows NT INTRANET 5.0 build 2195
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by alex ang -
Thx guys for contributing to the integration.

Do full screen slideshow applet and/or upload applet works?
My applets fail to start in moodle which is alert with "Gallery Remote can find no protocol implementation at url......".

I can start the applets through direct access gallery2.

Anyone had figure out how to fix this?
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Juvenal Sahiri -
Hello Mark,
I have a rather elementary problem. I installed Gallery2 successfully (winxp, Moodle 1.7). I see it in the activities and can select it when I click on Turn editing on. I enter the album name and other parameters. But I have been unable to find where to upload pictures. I tried doing this as administrator, course creator and teacher.

A related problem I am running into is seeing the course entry "create course" if I am not logged in as administrator, even if I am logged in as course creator.

Can you please give me steps to follow to upload photos into gallery from moodle?
Many thanks
Juvenal

In reply to Juvenal Sahiri

Re: Gallery Module: Gallery2 Integration

by Mark Nielsen -
Hi Juvenal,

The Gallery module has never been tested with 1.7 and it made for 1.6.3.

Cheers,
Mark
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Juvenal Sahiri -
Hi Mark,
I just tested gallery module on moodle 1.6.3
Installation successfull. After configuring the gallery in moodle (checked paths successfully).
It didn't matter whether I created an album related to a course or independently.

After clicking on submit changes, I got this error:
Url shows as: http://localhost/moodle/course/install/

Object not found!

The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

If you think this is a server error, please contact the webmaster.

Error 404

localhost
01/05/07 14:25:01
Apache/2.2.3 (Win32) DAV/2 mod_ssl/2.2.3 OpenSSL/0.9.8d mod_autoindex_color PHP/5.2.0

MUST BE DOING SOMETHING WRONG SOMEWHERE.

In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Stephen Auxter -
I am wondering when/if a 1.7 implementation will be available? We started with 1.7 since last November, and I thought I would give the module a try (hey, you never know). Doesn't work, of course. I can add the activity, but when I commit the changes, Firefox reports it "has detected that the server is redirecting the request for this address in a way that will never complete." I can go to my Gallery2 install, and the album is there. But that is about it. Seems like a strange redirect error. In IE7 (yuck) the browser just sits there, stuck in an endless loop.

Clicking on the activity as a student reports the same error. From what I understand, when this module works it is awesome. Can I please partake in the awesomeness? Anyone working on a 1.7 version? Or provide instructions on what to hack to make it work with 1.7? I am not afraid of the command line.

Using:
Ubuntu 6.06
Apache, MySQL, PHP
Moodle 1.7+
Gallery 2.1.2

http://moodle.chatham-nj.org/moodle
In reply to Stephen Auxter

Re: Gallery Module: Gallery2 Integration

by Richard Kassissieh -
This is a wonderful module, and I would encourage the authors or anyone else to help out with a 1.7 version. Of course, I would if I could, but you wouldn't want me writing PHP code for this project!

Richard

In reply to Stephen Auxter

Re: Gallery Module: Gallery2 Integration

by Julian Ridden -
I am reporting the same issue here. Any ideas?
In reply to Julian Ridden

Re: Gallery Module: Gallery2 Integration

by James Rudd -
I have modified the view.php code to remove the recursive redirection problem.
Also some of our users were having problems with a moving root for gallery, resulting in incorrect parent checks.

Replace view.php in mod/gallery/ directory with attached file to fix problem.
Has been tested on Moodle 1.8 with Apache 2.2.0.
In reply to James Rudd

Re: Gallery Module: Gallery2 Integration

by Andrew Atkinson -
Hello

I have just installed Gallery2 and the moodle integration on Moodle 1.8+
(2007021503) Apache/2.0.55 (Ubuntu) mod_fastcgi/2.4.2 PHP/5.1.6 added the view.php, however when adding a gallery activity SeaMonkey reports

Redirection Loop

Redirection limit for this URL exceeded. Unable to load the requested page. This may be caused by cookies that are blocked.

It does produce a link in the course, but clicking on it produces the same error.

Is the version of Apache likely to be the problem? I would prefer not to mess with it, if I do not have to!

Andrew
In reply to James Rudd

Re: Gallery Module: Gallery2 Integration

by Dean Mattson -
I have Moodle 1.8 and uploaded the Gallery2 files to my server. I got the paths page all worked out, but Gallery is not showing up on my Administration>Modules>Activities page. Can anybody clue me in to why that is happening?
In reply to Dean Mattson

Re: Gallery Module: Gallery2 Integration

by Dean Mattson -
Here's some screenshots, so hopefully somebody can help me figure this out.

I get the Gallery admin screen:

gallery_admin.jpg

I've checked the paths on both the directory and the URI and they're both okay. It says, "The above settings have not been set and saved," even though I've done this several times.

I click on Save changes and then next screen comes up and tells me "Changes saved."

Then the Activities screen comes up. No Gallery there.

activities.jpg

I'm not sure if this is a clue or not, but it does come up under Miscellaneous > XMLDB editor in the Site Administration pane.

xmldb.jpg

Anyone have a guess as to what's going on here?

In reply to James Rudd

Re: Gallery Module: Gallery2 Integration

by Julian Ridden -
Tried using your vie.php file and Gallery2 generated the following errors. Any ideas?

Error (ERROR_MISSING_OBJECT) : Missing object for 30
in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 1887 (GalleryCoreApi::error)
in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 98 (GalleryStorageExtras::_identifyEntities)
in modules/core/classes/GalleryStorage.class at line 298 (GalleryStorageExtras::loadEntities)
in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 71 (GalleryStorage::loadEntities)
in modules/core/classes/GalleryCoreApi.class at line 2251 (GalleryEntityHelper_simple::loadEntitiesById)
in modules/core/classes/GalleryView.class at line 359 (GalleryCoreApi::loadEntitiesById)
in modules/core/ShowItem.inc at line 133 (GalleryView::getItem)
in modules/core/classes/GalleryView.class at line 393 (ShowItemView::getItem)
in modules/core/classes/GalleryView.class at line 267 (GalleryView::loadThemeAndParameters)
in main.php at line 441 (GalleryView::doLoadTemplate)
in main.php at line 94
in modules/core/classes/GalleryEmbed.class at line 179
in /home/playpen/public_html/mod/gallery/view.php at line 104 (GalleryEmbed::handleRequest)

In reply to James Rudd

Re: Gallery Module: Gallery2 Integration

by Brad Felix -
I am also getting an error - any suggestions would be great! Thanks!

Error Detail -

Error (ERROR_MISSING_OBJECT) : Missing object for 17
  • in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 2075 (gallerycoreapi::error)
  • in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 98 (gallerystorageextras::_identifyentities)
  • in modules/core/classes/GalleryStorage.class at line 298 (gallerystorageextras::loadentities)
  • in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 71 (mysqlstorage::loadentities)
  • in modules/core/classes/GalleryCoreApi.class at line 2259 (galleryentityhelper_simple::loadentitiesbyid)
  • in modules/core/classes/GalleryView.class at line 359 (gallerycoreapi::loadentitiesbyid)
  • in modules/core/ShowItem.inc at line 133 (galleryview::getitem)
  • in modules/core/classes/GalleryView.class at line 393 (showitemview::getitem)
  • in modules/core/classes/GalleryView.class at line 267 (showitemview::loadthemeandparameters)
  • in main.php at line 441 (showitemview::doloadtemplate)
  • in main.php at line 94
  • in modules/core/classes/GalleryEmbed.class at line 179
  • in /Library/WebServer/Documents/mod/gallery/view.php at line 104 (galleryembed::handlerequest)

System Information

Gallery version 2.2.2
PHP version 4.4.4 apache
Webserver Apache/1.3.33 (Darwin) mod_ssl/2.8.24 OpenSSL/0.9.7l PHP/4.4.4
Database mysqlt 4.1.22-log
In reply to Brad Felix

Re: Gallery Module: Gallery2 Integration

by James Rudd -
We are running PHP 5.2.0, Apache 2.2.0, Mysql 5.0.18

Are you using an absolute path for Gallery 2 installation?

What are your settings for the Gallery Activity?
In reply to Brad Felix

Re: Gallery Module: Gallery2 Integration

by James Rudd -
What are you doing to get this error? Does it occur when you try to open the Gallery item in Moodle?

I just remembered I had a similar problem when I started but I'm not sure if it is the same one. Delete any albums in the course and recreate them. (Do not delete the Gallery 2 folders.) When recreating you can choose an existing folder from Gallery 2 if you wish or create a new one.

Also see:
http://gallery.menalto.com/node/48067

http://gallery.menalto.com/node/64706

Slightly similar to http://forum.4theweb.nl/archive/index.php/t-626.html

It means there is a fault in sync between Gallery 2 and Moodle. Moodle is giving an item id that does not exist. Recreating should fix up the IDs.

Seems to happen for the very first album created in Moodle.

Hope this helps fix the problem.
In reply to James Rudd

Re: Gallery Module: Gallery2 Integration

by Brad Felix -
Hi James,

I got some time and finally got this working! Despite setting the paths to absolute, we were still getting errors.

The key for us was to DOWNGRADE to Gallery 2.1 (we had 2.2.2 running). This did the trick. I used a fresh install and a new database in MySQL.

Also, for those running Mac OS X Server, this unfortunately ships with PHP 4.x without GD graphics support needed by Gallery. This was solved by installing PHP 5 from www.entropy.ch. Note you need to disable PHP 4 first in the httpd.conf file. This then BROKE our connx to the database, because you must specify the location of the MySQL socket file according to:

http://www.entropy.ch/phpbb2/viewtopic.php?p=9499#9499

Hope this helps others.

Brad

In reply to Brad Felix

Re: Gallery Module: Gallery2 Integration

by Julian Ridden -
Hey Brad,

Thanks for the news. I can confirm your findings on my end as well. I did as you suggested and it now all works well.

Thanks again.
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Ji Ming -

Great Module!

I have got this module working well with 1.8+ with the updated view.php. When a gallery already created in Gallery2 is selected in 1.8+ recourse and then erased / deleted in 1.8+ all the album contents and directories are deleted. Fine for most situations but what I would like to do is to JUST delete the link between Moodle and Gallery2 but have it still listed in Gallery2 itself. I would like to ONLY delete albums in Gallery2 and NOT have galleries deleted buy Moodle via the MGM module. How can I prevent the MGM module from deleting the album but JUST DELETE the Moodle listing to the gallery.

Ji 

In reply to Ji Ming

Re: Gallery Module: Gallery2 Integration

by Geoffrey Rowland -
Picture of Plugin developers
I'd agree with Ji on this one. It's been a long standing 'feature' of the Gallery-Moodle integration that deleting a Gallery link, deletes
the Gallery itself.

Mind you, I have only ever done this once, and took some time to rebuild the gallery. Since then I take more care wink

In reply to Ji Ming

Re: Gallery Module: Gallery2 Integration

by Mark Nielsen -
Hi Ji,

In the lib.php file there method called gallery_delete_instance() that has the following chunk of code that deletes the album in Gallery2:

$ret = GalleryCoreApi::deleteEntityById($instance->albumid);
if ($ret) {
// error($ret->getAsHtml()); // DEBUG
return false;
}

Remove it and you should be set.

Cheers,
Mark
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Mark Drechsler -
Hi Mark,

First time poster and moodle newbie to boot so apologies if this is a dumb question.

I'm considering a moodle/gallery implementation to support submission, peer reviewing and assessment of images, and I'm curious to have a play with a trial implementation, but the Gallery2 functionality doesn't seem to be running on the moodle trial site and I can't find any other trial sites anywhere else.

Any suggestions of a demo site that I could look at just to get a feel for the capabilities of how the two tools function together?

Thanks in advance,

Mark.
In reply to Mark Drechsler

Re: Gallery Module: Gallery2 Integration

by Mark Nielsen -
Hi Mark,

There are no demo sites that I know of, sorry.

Cheers,
Mark
In reply to Mark Drechsler

Re: Gallery Module: Gallery2 Integration

by Julian Ridden -
There is a demo available in the Moodle Playpen.

You can view an existing demo here or request your own course and play with the full functionality yourself.

P.S. The Playpen is running 1.9. Good to see the ode will continue to work in the next version.
Average of ratings: Useful (1)
In reply to Julian Ridden

Re: Gallery Module: Gallery2 Integration

by Mark Drechsler -
Hi Julian & Mark,

Thanks for the feedback, will have a go in the playpen.

Cheers,

Mark.
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Ji Ming -

Hello Everyone!

We got this module working fine with 1.8 with the updated view.php file. The intergration worked great.

However, after upgrading to 1.8.2+ we are unable to connect to the gallery. Now we get this error and are unable to delete the module from 1.8.2+

 Gallery User update failed
Error (ERROR_OBSOLETE_DATA) : UPDATE g2_Entity SET g_modificationTimestamp=?,g_serialNumber=? WHERE g_id=? AND g_serialNumber=? (1186282770|6|6|5)
in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 364 (gallerycoreapi::error)
in modules/core/classes/GalleryStorage.class at line 309 (gallerystorageextras::saveentity)
in modules/core/classes/GalleryEntity.class at line 294 (mysqlstorage::saveentity)
in modules/core/classes/GalleryUser.class at line 204 (galleryentity::save)
in modules/core/classes/GalleryEmbed.class at line 385 (galleryuser::save)
in /hsphere/local/home/site/sitegate.com/gallery/lib.php at line 556 (galleryembed::updateuser)
in /hsphere/local/home/site/sitegate.com/mod/gallery/view.php at line 91

Does anyone know how we can correct this error? Thanks

Ji

In reply to Ji Ming

Re: Gallery Module: Gallery2 Integration

by psicologo reyes -
i don´t know programer , i am psycologist..
and don't speak english...
but...i found a solution for
Error (ERROR_MISSING_OBJECT) : Missing object for 26..etc..
this is clear the word: $instance-> in the line;
<a
href=\"$CFG->wwwroot/mod/gallery/view.php?id=$cm->id&amp;g2_itemId=$insta
nce->albumid\">$instance->name
</a>

this line is in the view.php of the gallery mod, this archive is:
../../moodle/mod/gallery/view.php

unknow the real efect in the gallery..but it works.
i send the archive for your consideration...copy and paste.

i want automatic generate album for each one of the student from moodle only registering your name...some idea?

escuseme for me bad english...

In reply to Ji Ming

Re: Gallery Module: Gallery2 Integration

by Peter Evans -
I am also running 1.8.2+ and when trying to create a gallery in Moodle I get the following error:

Error Detail -

Error (ERROR_MISSING_OBJECT) : Missing object for 31
  • in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 2075 (GalleryCoreApi::error)
  • in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 98 (GalleryStorageExtras::_identifyEntities)
  • in modules/core/classes/GalleryStorage.class at line 298 (GalleryStorageExtras::loadEntities)
  • in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 71 (GalleryStorage::loadEntities)
  • in modules/core/classes/GalleryCoreApi.class at line 2259 (GalleryEntityHelper_simple::loadEntitiesById)
  • in modules/core/classes/GalleryView.class at line 359 (GalleryCoreApi::loadEntitiesById)
  • in modules/core/ShowItem.inc at line 133 (GalleryView::getItem)
  • in modules/core/classes/GalleryView.class at line 393 (ShowItemView::getItem)
  • in modules/core/classes/GalleryView.class at line 267 (GalleryView::loadThemeAndParameters)
  • in main.php at line 441 (GalleryView::doLoadTemplate)
  • in main.php at line 94
  • in modules/core/classes/GalleryEmbed.class at line 179
  • in /var/www/moodle/mod/gallery/view.php at line 124 (GalleryEmbed::handleRequest)

System Information

Gallery version 2.2.2
PHP version 5.2.1 apache2handler
Webserver Apache/2.2.3 (Ubuntu) PHP/5.2.1
Database mysqli 5.0.38-Ubuntu_0ubuntu1-log
Toolkits Thumbnail, Gd
Operating system Linux moodle 2.6.20-16-server #2 SMP Thu Jun 7 20:26:23 UTC 2007 i686
Browser Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6


Any ideas?
In reply to Peter Evans

Re: Gallery Module: Gallery2 Integration

by James Rudd -
As mentioned in the README.txt you must use the previous version of Gallery,

Gallery version = 2.1.2 core 1.1.0.2

Some core changes were made between versions and module doesn't work with new version.
In reply to James Rudd

Re: Gallery Module: Gallery2 Integration

by Angela Roberts -
Hello everyone!

I have installed Gallery2 in my root to be used by multiple Moodle sites. So it would be something like www.mydomain.com/gallery/ . Then I installed the gallery module www.mydomain.com/moodle/mod/gallery/ . When I did the set up for Gallery2 I chose the mult installation option....maybe this is my problem. I should try it the other way...anyway...

I have tried the view.php on the "most recent download" on the module download page and I have downloaded every single view.php on this thread. I have tried every single one and I am about to pull my hair out. I think I have found 5-6 different versions of view.php . I have even gone through the code to compare what the differences are!

I have installed and un-installed and deleted and re-created my gallery database about 4 times. And I am officially at my whits end.

I am using the Gallery 2.1.2 and directed.

These are the problems that I am having:

1. I have two galleries in Moodle that are there from previous installs of Gallery that I can't get to erase. So, since I re-installed Gallery, they are not in the Gallery. But I can't get them to go away from my Moodle class. If it is a pain, I can just re-create the class. Maybe that would solve it.

2. Sometimes I can get a gallery to delete, sometimes I can't. It depends on the version of view.php I have running. But, since I have tried so many versions I don't know which is which anymore. But, ultimately what I want is the ability to erase a gallery from a class without erasing it from the gallery. But, I also want a way to be able to delete it from the gallery at a later time.

3. When I click on a gallery in my course, it just takes me to one main gallery. It appears that when I create a gallery all the images just end up in one huge gallery, not separate ones. So, when I click on the gallery in the course it takes me to the gallery main page with all the photos from all the Albums. Not to the photos in the Album I want.

If I create an album directly in Gallery then I can have an Album correctly set apart. Those albums will show up in the huge gallery as options of albums to choose. But when I click on a link in the class, Moodle takes me to the big gallery.

I was thinking as a workaround I should just create Albums in Gallery and then instead of add a Gallery to my class, just add a link to the right URL for that Gallery. But, would I loose the breadcrumbs etc?

And, from within Gallery is there a way to move from Album to Album or see a list of the Albums that are in Gallery. I don't see any really good navigation around the Gallery. Maybe I am missing something.

Is there anyone out there that is willing to help me?

Here I will throw out a bone....while I was creating this class I created a Hybid Format that includes ajax. So the format has a heading...then a "social forum" type area (like the social forum) then after that are the topics just like you would see in a Topics format.

I am working in Moodle 1.9+ so it works in 1.9

Thanks in advance!!!

angela
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Karl Linne -
Hallo,
Bei der Konfiguration des MgM werde ich als Zweites nach der "g2uri". Was ist denn das?

Für Hilfe dankbar: Karl
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Charles Applegate -

I have successfully integrated Gallery2 (2.1.2) with Moodle 1.8.2+, using the Moodle gallery module.

However, I would now like Gallery2 (in Moodle) to play flash videos (flv)- ie. have a nice flash player embeded into the web page.

The problem I have is that the Gallery2 Moodle integration currently seems to work with Gallery2 2.1.2 and Moodle 1.8.2, but it won't work with the latest version of Gallery2 (2.2.2).

In the latest version of Gallery2, there is a module called flashvideo which does what I need- plays a flash video in the web page! But this feature isn't available to previous versions of Gallery2 (In the site admin --> modules page of Gallery2, It gives an error saying "Core API Required: 7.9 (available: 7.3)" ).

Any ideas of how to solve this, or at least another easy way to have flash players in the html pages (without adding any javascript/html code manually)?

Thanks,

Charles.

gallery2.1.2.jpg

In reply to Charles Applegate

Re: Gallery Module: Gallery2 Integration

by Jonathan Konrad -
Sorry, I need to catch up to where you are. Does anyone have a link for the gallery 2.1.2 download? I can only find 2.2.3. Thanks.
In reply to Jonathan Konrad

Re: Gallery Module: Gallery2 Integration

by James Rudd -
You can download it from the Gallery2 website.

I have added links to all the files you need on my site,
http://jrudd.org/wordpress/2007/11/30/moodle-and-gallery-212/

It has link to Gallery 2.1.2, Moodle Gallery2 Module and a modified view.php I posted in the forums that fixes the endless redirection bug.
In reply to James Rudd

Re: Gallery Module: Gallery2 Integration

by Jonathan Konrad -
Thank you for the quick response. I will inform this group if I have a unique problem or solutions. Again, thanks.
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Thomas Michalak -
Gallery2 module with moodle 1.9.4

Does anybody get both to work togehter?

I use 184 an the suggestet Gallery Installation - all fine.

After upgrading (in a testin surrownding) to 194 gallery is not longer working: Pages are empty. Seems to be a problem with rightsmanagement: If i try to adminstrate toe module gallery default rights for students can not be set.

Can somebody help?

MFG, Thomas Michalak, Berlin
In reply to Thomas Michalak

Re: Gallery Module: Gallery2 Integration

by Gary Day -
This Module is working great in 1.9 (11th March)
It'd be fantastic if it could be updated to work with G2 2.2.* for compatibility with the G2 Flash Video Module.


Thomas, try reasserting (recursively) the rights on the entire gallery2 and g2data folders.
I don't know what system you are installed on so refer to gallery2 readme for this.
In reply to Gary Day

Re: Gallery Module: Gallery2 Integration

by Nicolas Sicard -
Hi,

I can't have it working on 1.9 (10 may). I get the following error message :

Warning: Cannot modify header information - headers already sent by (output started at /home/www/campus/lib/weblib.php:2838) in /home/www/campus/mod/gallery/gallery2/main.php on line 30

Fatal error: Call to undefined function GalleryInitFirstPass() in /home/www/campus/mod/gallery/gallery2/modules/core/classes/GalleryEmbed.class on line 110

Any idea ?

Thanks,

Nicolas.
In reply to Mark Nielsen

Anyone has ever tried to share Gallery2 by more than one Moodle sites?

by William Lu -
Picture of Particularly helpful Moodlers
It is working perfectly on my Moodle1.9 (PHP4.4, MySql4.0). Thank you very much.

The student can only access the album from their own course resource which I created separate ‘gallery/album’ for a specific topic. It is fantastic.

Even better, the gallery displays under the Moodle's bread crumb trail, so no one know where the root gallery is.

So, I am wondering, is it possible to share the gallery installation by different Moodle sites? I got several Moodle sites in different server with different domain name and databases. Can I only install your MGM module into all my Moodle sites, but they all share ONE Gallery2? (I want to be lazy, but dare not to try. I am afraid that two or more Moodle sites accounts may conflict each other).

In reply to William Lu

Re: Anyone has ever tried to share Gallery2 by more than one Moodle sites?

by William Lu -
Picture of Particularly helpful Moodlers

Dear Mark,

All my Moodle sites on same server have been able to share ONE Gallery2 successfully! Any new gallery instances (added in Moodle courses) can has its own permission setup. And the students can only see their own album. No users can find out there are sharing the gallery2 with other sites. WoW, that’s so efficient! Save saver space and time (money)! Thank you very much Mark!

In reply to Mark Nielsen

why do we need the ‘create link’ function and how to disable it

by William Lu -
Picture of Particularly helpful Moodlers

I want to know why do we need the ‘create link’ function and how to disable it.

The students can click on the “Create link” link to see: Link an item: Source: Choose the items you want to link: Check All: Destination:choose a new album for this link:link

Luckily, I can set permission to students can only see ‘Destination’ of their own album. (They cannot see my other hidden albums)

But, they DO can create, actually duplicate or copy, other students’ photos and all these replicas shows a new owner. It is a big plagiarism problem!

Please anyone can help me to disable the “create link” function.

I’ve uninstalled the “Link Items” but no difference.

Gallery version 2.1.2
PHP version: 4.4.7
MySql4.0
Integration with Moodle1.9
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by d morte -
Hi, I'm having a problem with getting Gallery to work. I installed Gallery, and then placed the MGM into the mod folder. I then set the paths and received verification of the paths. When I go to create an instance of the gallery, I get to the setup screen and all goes well until I attempt to save changes. Once I click save changes (before ever doing anything with pictures) my browser returns "Firefox has detected that the server is redirecting the request for this address in a way that will never complete."

Anyone have any ideas? I'm on 1.9
In reply to d morte

Re: Gallery Module: Gallery2 Integration

by d morte -
Sorry about that, I missed the thread where this was answered. I have now installed the view.php file and am no longer getting the loop.

BUT...

I'm now having some other problems. The layout is very awkward, and doesn't look anything like any screen shots that I have seen before. Could this be a result of an interaction with my theme? Also, while I can upload pictures, I can't view the pictures at all. There are no thumbnails, nor does the picture appear when I click on the name. Any suggestions?

p2.png(I've attached a screen shot)
Attachment Picture_2.png
In reply to Mark Nielsen

Gallery Module: Gallery2 Integration (unable to search)

by Hellmuth Sole -
Hi all, I'm using Moodle 1.9.1 and Gallery 2.2.4 though a GoDaddy hosting account. The integration was "nearly" flawless, since it does integrate perfectly into my moodle skins and images are seen both in thumbnail view and in full size. The batch uploading procedure is also great!!

The issue I'm having is when I use the search function. When I try to search directly using the Gallery2 interface, I have no problem. However, when I attempt to search from Moodle (with the search function embedded from Gallery2) I get the following message:

The item you are attempting to view does not belong to this Gallery.

I try to search tags, parts of the filename, even the exact filename, and all return this result.

Any ideas??
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Jean FRUITET -

I have made modifications in scripts index.php and view.php to get rid of error messages in Moodle Gallery Module for Moodle 1.9.

Now if function build_navigation() from Moodle 1.9 exists then function print_header() uses  'build_navigation'. 



In reply to Mark Nielsen

Re: Gallery Module: German lang file de_UTF

by Guido Hornig -
Picture of Plugin developers
A wasable to use gallery 2.2.5 with moodle 1.9.2+

The mod is awefull.
Thank you.

I posted my german lang file.
But I never translated the help files.

My suggestion for further development:

1) Support of albums in album, until now, I discovered only the first level.
2) a HOW TO for putting single pictures in the course
3) provide a block, showing the newest uploads.


Mark is my favorite mod hero!
In reply to Guido Hornig

Re: Gallery Module: German lang file de_UTF

by Hellmuth Sole -
Hi Guido, one question, once you integrated the module with gallery, were you able to use the search function in moodle to find a specific picture. The plugin works for me, but will return an error when I search for files.

Did you use apply the patch Jean Fruitet posted? I did and it actually broke my integration with gallery, so just about ready to give up on this and go with the lightbox plugin, but would much rather prefer to use gallery 2.

Thanks!
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Chris Kenniburg -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Is it possible to have Gallery on another server than Moodle and still have this work? I currently have gallery on a windows server and Moodle on a mac server.

Any help would be appreciated.
Thanks,
Chris
In reply to Mark Nielsen

Re: Gallery Module: Error about mod.html

by Jonathan Konrad -
I am getting this error message when I try to add a Gallery Integration activity in a course:

This module cannot be added to this course yet! (No file found at: ../mod/galleryintegration/mod.html)

I have Gallery 2.2.5 installed into a gallery2 folder within moodle. I then installed the gallery2 integration module for Moodle 1.9.1. I ran the setup which correctly created the table in my MySQL database. I then "installed" the module from within the administration area. Finally I created a new course and then tried to add the activity.

What is a bit strange is when I checked my Gallery 2 site, a new album had been automatically created by this mod in Moodle for my new course. I just can't seem to activate it or something. Any help here. I feel so close since Moodle is actually creating albums that match the course names.

Also, is there a quick way to create albums for existing courses and users? Thanks.
In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Gianpaolo Valero -
Hi,

I want to add some pictures to my course and found your plugin. The thing is that i really don't get how it works. I have to install Gallery2 on my computer. And then what? I upload pictures to Gallery2 or what?. I cheked flickr plugin but i like yours more. The only thing is that i don't know how to get it to work.


In reply to Gianpaolo Valero

Re: Gallery Module: Gallery2 Integration

by Heidi Peter -

Hi,

i have this problem:

"URI is Incorrect. Attempted to open Gallery2's main.php."

But i am totally sure, that the path i added is correct. I tried ..// in the beginning and / at the end, changed the path etc. pp.

I read the whole post here but did not find a similar problem (only the thing with embed.php, i tried the suggestions but it did not work on my moodle).

i am using moodle version 1.9.3+  with php 4.3 and mysql 4. I downloaded gallery into mymoodle/../mod/gallery and gallery2.2.6 into mymoodle/../mod/gallery/gallery2.

The first path for the gallery2 directory is set/running correct, but the

path for the URI is always incorrect. 

Does anybody know a solution ? I would be very lucky about that, because this module seems to be perfect for my homepage smile.

Heidi


In reply to Heidi Peter

Re: Gallery Module: Gallery2 Integration

by debbie deem -

I have the same problem today Heidi.

the first path checks out as correct, but the second one does not.

When it tells me the path is incorrect to main.php - if I copy that url and paste it in my browser it is correct.

have tried alot of variations with no luck

dd

In reply to debbie deem

Re: Gallery Module: Gallery2 Integration

by Heidi Peter -

Hi Debbie,

i had a mail exchange with Mark Nielsen (Mark, i liked your explanation and copy it in here smile). So if you are sure that the value of that field is correct (with the forward slash at the end) and your gallery modul works on that path in your browser, you could just say save it and then try using the module anyways and see if it works. Another value you could try is /gallery2/ if your Moodle is installed at the same domain as Gallery2. If all the above fails and your Moodle and Gallery2 are installed at different domains, then I suggest try installing them in the same domain and same web root directory.

Regards, Heidi

In reply to Heidi Peter

Re: Gallery Module: Gallery2 Integration

by Matias Hernández -
(First sorry for my english)
I have trying to configure this module, i was install gallery2 successfully and tri the module, but i have this error when i tri to use it with a profesor (i try to add it like a activiti in a course).

Gallery User update failed
Error (ERROR_MISSING_OBJECT) : 10676 GalleryUser
  • in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 155 (gallerycoreapi::error)
  • in modules/core/classes/GalleryCoreApi.class at line 2404 (galleryentityhelper_simple::loadentitybyexternalid)
  • in modules/core/classes/GalleryEmbed.class at line 434 (gallerycoreapi::loadentitybyexternalid)
  • in /home/devlms/public_html/moodle/mod/gallery/lib.php at line 556 (galleryembed::updateuser)
  • in /home/devlms/public_html/moodle/mod/gallery/mod.html at line 26
  • in /home/devlms/public_html/moodle/course/mod.php at line 670
Some idea to fix it?

Thanks a lot

In reply to Matias Hernández

Re: Gallery Module: Gallery2 Integration

by Eleanor Ramsay -
Hi all,

Has there been any updates to this module? I have Moodle 1.9.7 installed and working I am trying to use the mod with Gallery 2.3, the only version I can find. I guess it is not compatible.

I tried overwriting the view.php and index.php files with the ones in this thread, which took care of the looping but now I just get errors similar to the one's above. I cannot seem to delete the non-functioning gallery, either.

This is such an exciting mod. Is anyone using it currently?

Does anyone know where I could get a copy of 2.1.2? Would that work?

Any info would be appreciated!


In reply to Eleanor Ramsay

Re: Gallery Module: Gallery2 Integration

by John Andrewartha -
Me to.
I keep getting from FF Moodle 1.9.7 php 5*
The page isn't redirecting properly
----------------------------------
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

* This problem can sometimes be caused by disabling or refusing to accept
cookies.
--------------------------------

Otherwise Gallery2 works fine Moodle as well. All the software is todays release.

John







In reply to John Andrewartha

Re: Gallery Module: Gallery2 Integration

by Dennis Green -
It times-out in IE, but if you reload the page it swiftly opens it correctly. Pretty weird.

"
This webpage has a redirect loop.

The webpage at http://********.***/mod/gallery/view.php?id=923&g2_view=core.ShowItem&g2_itemId=42 has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.
"

It works fine other than that.
Can anyone please help?
In reply to Dennis Green

Re: Gallery Module: Gallery2 Integration

by Jean FRUITET -
I thought that gallery2 did not accept PHP directive "safe_mode=ON" which is Moodle recommanded setting...
If so, you can't make gallery2 works fine on the same server than moodle.
But I can be wrong.

http://gallery.menalto.com/requirements

This is an excerpt from
http://codex.gallery2.org/Gallery2:Installation_Requirements

PHP Version Compatibility

Gallery requires at least version 4.x (4.3.0 or more recent) or 5.x (5.0.4 or more recent) to function properly. Note: Gallery 2 has problems with PHP 5.0.5 due to a bug in PHP .

Notes:
  • PHP 5 is highly recommended - PHP will not release any security updates for PHP 4 after 2008/08/08. If your webhost is still running PHP 4, please ask them to switch to PHP 5 as soon as possible for security reasons (not just for Gallery, but for all PHP applications).
  • Only Gallery 2.3.1 supports PHP 5.3. PHP 5.3 is incompatible with Gallery 2.0 - 2.3.
  • PHP 6 is incompatible with Gallery 2.0 - 2.3; not yet tested with Gallery 2.3.1

PHP Settings

In addition to a basic PHP installation, Gallery requires certain PHP settings to be setup correctly in order to function optimally.

PHP settings can be changed in php.ini, as described in the PHP documentation

  • safe_mode safe_mode must be disabled in order for Gallery to work correctly
    • for a in depth discussion on safe mode please read this forum thread.
  • disable_functions The disable_functions directive must not include the function set_time_limit.
  • file_uploads file_uploads must be set to On if Gallery is to be able to upload files from your computer
  • upload_max_filesize and post_max_size These configuration parameters control the maximum file size that can be uploaded. Adjust these from the default 2M setting to something larger if you have problems uploading pictures from higher resolution cameras.
  • If you want to use the localization feature then PHP should be configured with the gettext option enabled.

alindeman has created a script to check your Gallery for potential problems due to PHP settings. Download the script and upload it to your host. Open the script in your browser (http://www.example.com/gallery/ghcc.php). If any tests fail, you may need to adjust your settings before trying to install Gallery.


In reply to Jean FRUITET

Re: Gallery Module: Gallery2 Integration

by Geoffrey Rowland -
Picture of Plugin developers

Hi Jean

Actually, that is not completely correct. For full functionality, Moodle requires Safe Mode to be off too! Indeed, Safe Mode has been removed from PHP6

http://www.breakingpointsystems.com/community/blog/php-safe-mode-considered-harmful

So it is possible to run Gallery alongside Moodle. I'm doing it, albeit with an older version of Gallery2 (Gallery version = 2.1.2 core 1.1.0.2)

In reply to Geoffrey Rowland

Re: Gallery Module: Gallery2 Integration

by Moshe Golden -

I need some help.

I am running the following system:

Moodle 1.9.5

PHP 5.2

Gallery 2.3.1

I installed Galery and it seems to work ok.

I also Installed MGM and the the installation went OK and it appears in the activity list.

When I try to create a new instance of gallery I get wierd reactions or error messages depennding on the browser.

With IE7 the browser does not seem to finish.  It will keep running until stopped manually.

With firefox the browser returns a page indicating that there are too many redirects.  Alternatively, I get the following message:

Gallery User update failed
Error (ERROR_MISSING_OBJECT) : 2 GalleryUser

  • in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 155 (GalleryCoreApi::error)
  • in modules/core/classes/GalleryCoreApi.class at line 2404 (GalleryEntityHelper_simple::loadEntityByExternalId)
  • in modules/core/classes/GalleryEmbed.class at line 434 (GalleryCoreApi::loadEntityByExternalId)
  • in /var/www/moodle/mod/gallery/lib.php at line 556 (GalleryEmbed::updateUser)
  • in /var/www/moodle/mod/gallery/mod.html at line 26
  • in /var/www/moodle/course/mod.php at line 726

Any assistance would be appriciated.

Moshe  

In reply to Moshe Golden

Re: Gallery Module: Gallery2 Integration

by Heidi Peter -
Hi Moshe,

maybe this will help you:
http://jrudd.org/wordpress/2007/11/30/moodle-and-gallery-212/

Regards,
Heidi
In reply to Heidi Peter

Re: Gallery Module: Gallery2 Integration

by Pascal SORE -

Hi!

I've installed the last version 2 (Gallery 2.3.1) and tried any solutions proposed on the forums and any versions of MGM ... Whitout a good result!

Is anybody here who could post in this forum a functional version of MGM with Moodle 1.9.9 ? thoughtful

Sorry for my bad english blush

In reply to Pascal SORE

Re: Gallery Module: Gallery2 Integration

by Heidi Peter -

Hi Pascal, what did you do until now? Can you describe what you did a little bit more detailed?

Regards,

Heidi

In reply to Heidi Peter

Re: Gallery Module: Gallery2 Integration

by Pascal SORE -

Hi Heidi,

Sure I can wink!

Thank you for your answer. I'm the Moodle administrator for a school in France. About 1200 students are connected to Moodle since 3 years now.

My aim is to connect Gallery to Moodle so that students and teachers could share albums in a secure environment. Gallery seems to be a tool which could answer to my wishes but I don't want users have to create another account. It would be better if they could use the moodle one.

I installed Gallery3 but it seems impossible to interface it with Moodle. So I've installed Gallery 2.3 but all my tests has been unsuccessfull!

Perhaps anyone in this forum could help me giving a link or the working files view.php and config.html?

Thank you very much for your help, It's an hopeless situation at this time sad

Best regards

Pascal

In reply to Pascal SORE

Re: Gallery Module: Gallery2 Integration

by Heidi Peter -

Hi Pascal,

the aim of my question was, what did you do until now, to integrate your gallery into your moodle plattform?

May be i can give you a little help with the steps i did to integrate the gallery into my moodle:

1. Create a Subdomain for your gallery on your homepage.

2. Create a Database for your gallery on your homepage.

3. On my plattform i used gallery 2.1.2 full, that worked. I installed it on my in 1. described subdomain.

optional: (4. It is possible, that the php.ini has to be changed, so that exec() has to be set on "allow". In this case you have to put a file ".htaccess" in your folder: your moodle/gallery. The ".htaccess"-file has to have the following content: AddHandler php-fastcgi.php)

5. Now, after doing step 1.-4. (not earlier) you can start to integrate the gallery-module into your moodle as an interface between your moodle and the gallery 2.1.2 you installed on your subdomain.

6.Put your gallery-module into your moodle/mod/gallery

7. Go as an admin to your moodle->Administration->Notifications. Your gallery-module has to be installed.

8. Than, you have to set the right path in: moodle->Website->Administration->Modules->Activities-> Configure path. Check your path whether it is correct.

9. After that, it should work.

I had some problems with the Firefox. It created an endless loop. But the change of the view.php helped. Here is a link to the right view.php

http://jrudd.org/2007/11/moodle-and-gallery-212/

Maybe these informations will help you.

Regards, Heidi

In reply to Mark Nielsen

Re: Gallery Module: Gallery2 Integration

by Nancy del Pilar Garrido Labbe -

That answer is to Mark Nielsen, I can see you has finished your beta version of the Moodle Gallery Module (MGM) on 2006 but now is 2011 and exist Moodle 2.0.   I try to use the MGM and doesn´t works in Moodle 2.0. ¿Have you have some intentions of actualization...to Moodle 2.0?.

I´not an expert in this matters and is very difficult for me do it for my own... o maybe you can try to do some actualizations...

Sorry for my english my native language is spanish... thanks