Galler2 Integration updated

Galler2 Integration updated

by Don Balentine -
Number of replies: 46
This is a minor update to Mark Nielsen's Gallery2 Integration module.  I have tested and have this module working with Gallery 2.1.2 on Moodle 1.6.2.
Average of ratings: -
In reply to Don Balentine

Re: Galler2 Integration updated

by Dirk Grunwald -
Thanks very much for your work. Your changes appear to work fine with 2.1.2 and 1.6.2

I'm having one problem that I also had with the original 'gallery' module.

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

The root for the moodle is /var/www/html/moodle-1.6.2

I installed gallery2 as /var/www/html/gallery-2.1.2 and then symlinked to
/var/www/html/moodle-1.6.2/gallery2

This lets me visit http://moodle.cs.colorado.edu/gallery2 and set up the gallery.

When I create a gallery in Moodle, the CSS links are incorrect - they don't have the leading '/gallery2' in them.

For example, from my sample gallery, I have the following..

   <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="http://moodle.cs.colorado.edu/theme/standard/styles.php" />
<link rel="stylesheet" type="text/css" href="http://moodle.cs.colorado.edu/theme/chameleon/styles.php" />

<!-- Gallery Header Info -->
<script type="text/javascript" src="modules/search/SearchBlock.js"></script>
<link rel="stylesheet" type="text/css" href="modules/icons/iconpacks/paularmstrongdesigns/icons.css"/>
<link rel="stylesheet" type="text/css" href="themes/matrix/theme.css"/>
<!-- End Gallery Info -->

<meta name="keywords" content="moodle, systems: Pictures " />
<title>systems: Pictures</title>
    <link rel="shortcut icon" href="http://moodle.cs.colorado.edu/theme/chameleon/favicon.ico" />

I can fix this by putting an explicit <link .../> in themes/chamelon/header.html that includes the
/gallery2 CSS files mentioned above. This makes it brittle and difficult to update styles.

Looking at mod/gallery/view.php, those CSS (and javascript) links are provided by G2 using
list($title, $gallerycss, $javascript) = GalleryEmbed::parseHead($g2data['headHtml']);
I'm not certain what I would need to change in gallery-2.1.2 to have it prepend a /gallery2 to
the CSS.

Any suggestions?
In reply to Dirk Grunwald

Re: Galler2 Integration updated

by Dirk Grunwald -
Doh, found it.

In /var/www/html/gallery2/config.php

I modified

$gallery->setConfig('galleryBaseUrl', '/gallery2/');

and life is happy
In reply to Don Balentine

Re: Gallery2 Integration updated

by Geoffrey Rowland -
Picture of Plugin developers
Hi Don

Thanks for this update. Just a little paranoia surprise on my part. The bundled README.txt still states:

Development Environment:
    Moodle:   Moodle  1.6 HEAD
    Database: MySQL   4.1.16
    Gallery:  Gallery 2.0.4

NOTE: Gallery 2.1 Blackjack is NOT compatible due to "many changes to the core framework"

1.  Install Gallery2.0.4 from http://codex.gallery2.org/index.php?title=Gallery2:Download&oldid=8035

Presumably it is safe to ignore this, and it works with Gallery 2.1.2

Regards

Geoff
In reply to Geoffrey Rowland

Re: Gallery2 Integration updated

by Don Balentine -
Thanks for noting this.  I uploaded the original package with just the modified files.  I will go through the files today and make the appropriate changes.  I will try to post an updated version later today.
In reply to Don Balentine

Re: Gallery2 Integration updated

by Don Balentine -
Here is an updated version of the zip file.  It has the updated readme.txt file with the correct version information.
In reply to Don Balentine

Re: Gallery2 Integration updated

by Geoffrey Rowland -
Picture of Plugin developers

Don

Thanks for this. I'll give this a go on our test server and feedback experiences.

A couple of follow-up questions

Does the (simple) upgrade route for Gallery 2.0.x to 2.1.2 outlined in

http://codex.gallery2.org/index.php/Gallery2:Download

work OK? Any 'gotchas' to look out for?

 

Given the switch to UTF-8 for the MySQL database in Moodle 1.6, is it necessary to install/upgrade the Gallery 2 database as UTF-8?

Regards,

Geoff

In reply to Geoffrey Rowland

Re: Gallery2 Integration updated

by Don Balentine -
Geoff,
First off my apologies on the delay in respodning. I've been busy at work with a few other projects and have not had time to check the forums here.

Hopefully you got everything installed and working correctly. To my knowledge there should be no issues with an upgrade. I did a fresh install on my system, so I can't vouch for the upgrade, but it should not effect the moodle integration any.

Thanks for the feedback.

Don
In reply to Don Balentine

Re: Galler2 Integration updated

by Jason Hollowell -
Picture of Particularly helpful Moodlers
Hello and thanks,

I've been successful in installing the Gallery2 integration module but have a couple of questions/problems.

First, when I click on the breadcrumbs for the gallery or on the link for the gallery that appears in the activities block I get an error that reads "a required parameter was missing" (see attached screen capture below) with the "continue" button below it. Clicking on continue takes me to my Moodle front page. This is an issue that I have with another module (attendance). Not sure what causes this.... Any ideas?

Second, is there anyway to clean up the look of the Gallery2 integration? What I mean here is that I have a bunch of links that appear when I access my Gallery through Moodle. Pasted below:

(Advanced Search Add Album Add Album To Cart Add Comment Add Items Edit Album Edit Captions Edit Permissions RSS Feed for this Album Show Debug Tree View Latest Comments View Slideshow View Slideshow (Fullscreen)

and two photos always appear, even if they are the same photo, when I view the Gallery.

It doesn't look very slick at all as I have it now. Maybe I need to adjust the configuration through Gallery directly? and then view it through Moodle?

Any advice will be appreciated.

Jason

Attachment reqpara.jpg
In reply to Jason Hollowell

Re: Galler2 Integration updated

by Jason Hollowell -
Picture of Particularly helpful Moodlers
Here is the messy interface I'm dealing with. It looks a lot nicer when I visit my Gallery2 install directly (nice little icons etc.)

Jason
Attachment moodleview.jpg
In reply to Jason Hollowell

Re: Galler2 Integration updated

by Jason Hollowell -
Picture of Particularly helpful Moodlers
I'm guessing this is how I should see it through the Moodle integration. This is a screen capture directly from my Gallery install. I'm running Moodle 1.6.3 on a hosted site with Php 4.4.4, MySql 4.1.21, Linux, Apache 1.3.37

I'll stop my machine gun series of posts now smile Sorry for the overkill.

Jason
Attachment shouldsee.jpg
In reply to Jason Hollowell

Re: Galler2 Integration updated

by Don Balentine -
Jason

I will have to look into the required parameter missing issue. As of right now I'm not sure what is causing that. I'll try and look at it in the very near future.

As for the menu, it is on my list of things I really wanna do. When I updated the gallery2 module I was in a rush as we needed it ASAP. A few of the teachers have mentioned the menu to me. I will hopefully be able to work on this soon.

I apologize that I don't have any real solutions for your problems at the moment. As soon as I do, I will post them here for you.

Thanks for letting me know of these items and please let me know if you find any other bugs.

Don
In reply to Don Balentine

Re: Gallery2 Integration updated

by David O'Brien -
Hi
I have just run through the set up of gallery 2 and have it installed. The only problem I can see is the same as Jason, I.E the page seems to be missing the associated style sheet. I have had a poke around with my limited knowledge but cannot find anywhere to add/correct any style sheets info for the gallery. Does anyone know where that might live? Or am I thinking that this would be too easy a fix!!
Regards
In reply to Don Balentine

Re: Galler2 Integration updated

by Jason Hollowell -
Picture of Particularly helpful Moodlers
Don,

No problem, you certainly don't have to apologize smile I wouldn't have a clue without the integration that you have developed so far. Just wanted to throw in my feedback/issues in hopes that it was either something that others are having trouble with or that maybe I'd just made some silly mistake. Sounds like it is the first of those two so I'll wait for a fix. I wish I could help but I'm afraid that my coding skills are almost nill but I'm always willing to test new development versions.

Thanks

Jason
In reply to Jason Hollowell

Re: Galler2 Integration updated

by Don Balentine -
Jason

I'm attaching a newer version of the module. It fixes the issue with "A required parameter was missing". Please test it out and let me know if it still has any problems.

I will hopefully return soon with a fix to the layout.

Don
In reply to Don Balentine

Re: Galler2 Integration updated

by Jason Hollowell -
Picture of Particularly helpful Moodlers
Don,

Wow, that was fast smile I have downloaded and installed the updated version and can confirm that the "A required parameter was missing" problem has been fixed. I will play with it more today to see if any problems arise but so far it seems great. Looking forward to the layout fix smile Thanks

Jason

In reply to Jason Hollowell

Re: Galler2 Integration updated

by Alexander Kuo -
Hi Don,
    Thanks for your great contributions to Gallery function!
    I have installed your latest version and to my sadness, I have the same problem as Jason.  In fact, "A required parameter was missing" problem has been fixed in my site. And, the layout problem still exists! Besides, when my students try to enter the gallery I set, they will get an error message, which reads, Fatal error: Call to a member function getId() on a non-object in /usr/local/www/data/moodle/mod/gallery/locallib.php on line 270
     Did I do something wrong or I didn't install it correctly?
Alexander.
In reply to Alexander Kuo

Re: Galler2 Integration updated

by Don Balentine -
Alexander

Thanks for giving the module a try. Can you tell me a bit about your site. What version of Moodle, and Gallery2 are you using? I'm not sure what the error is exactly. Let me know your versions and you might try the newest copy of the module I added today.

Don
In reply to Don Balentine

Re: Galler2 Integration updated

by Alexander Kuo -
Hi Don,
    First, thanks for your reply!
    The following is some information about versions: Moodle 1.6.3    Mysql: 4.1.19   Gallery2: 10-25-06 
Alexander.
In reply to Alexander Kuo

Re: Galler2 Integration updated

by Don Balentine -
Hi Alexander
What version of Gallery2 Standalone are you running?

Don
In reply to Don Balentine

Re: Galler2 Integration updated

by Alexander Kuo -
Hi Don,
    Gallery2 standalone is 2.1.2
    Sorry for not giving detail information.
Alexander.
In reply to Jason Hollowell

Re: Galler2 Integration updated

by Amy H -
From a post earlier:

"In /var/www/html/gallery2/config.php

I modified

$gallery->setConfig('galleryBaseUrl', '/gallery2/');

and life is happy"

this fixed the layout issue for me.
In reply to Don Balentine

Re: Galler2 Integration updated

by Amy H -
I have downloaded and installed this and it does fix the a required paramter is missing issue.

However, If I try to delete a course with galleries in I get the following error:

Fatal error: Call to undefined function: iserror() in /home/usr/public_html/moodledir/mod/gallery/lib.php on line 248

I'm not sure if this was there before as I have only just started to try to delete my test courses. It then stops and doesn't completely delete the course
In reply to Amy H

Re: Galler2 Integration updated

by Don Balentine -
Amy

Thanks forpointing that out. I left some code in there that needed to be removed. Between Gallery 2.0 and 2.1 they removed the use of isError().

I have also figured out the layout issue. I hope to have it all implemented and release an update later today.

Thank you all for your help and patience with this module.

Don
In reply to Don Balentine

Re: Galler2 Integration updated

by Priya Saini -

Hi All,

Is gallery2 working fine with Moodle 1.6? I am having some problem while setting it up online. The links in the gallery are dangling.

Please help.

Priya Saini,

In reply to Priya Saini

Re: Galler2 Integration updated

by Amy H -
It's nearly working, I have issues with deleting courses, but other than that I'm not having problems, but then I'm not really testing it either as we're not live yet.

That do you mean by the links are dangling?
In reply to Don Balentine

Re: Galler2 Integration updated

by Don Balentine -
Here is the latest version of the Gallery2 integration for Gallery 2.1 module.

Fixed an issue preventing courses from being deleted.
Added information into the Readme.txt file on how to fix the layout from Gallery2 to Moodle.

Being relatively new to PHP I'm a little stumped on the layout issue. I'm running short on time these days, so I can't chase it as much as I would like to. I have added information on how to adjust the Gallery2 config file to correct the layout issue. Hopefully I can get that resolved soon.

Enjoy and Thank You.

Don
In reply to Don Balentine

Re: Galler2 Integration updated

by Jason Hollowell -
Picture of Particularly helpful Moodlers
Don,

Great job! Thanks. I have installed this newest version and have made the changes to my Gallery config.php file which solved my layout issue. I haven't tried to delete a gallery yet so I cannot comment on that problem but so far this is looking great. Thanks again.

Jason
In reply to Don Balentine

Re: Gallery2 Integration updated

by Geoffrey Rowland -
Picture of Plugin developers
Don

A big thanks for your work on this cool. All seems to be working well, including the layout fix, for our setup (Moodle 1.6.2+, MySQL 4.1.20, PHP 4.3.9), although I have not yet tested Gallery deletion.

Indeed, I can also confirm that a Gallery 2.0.4 to Gallery 2.1.2 upgrade worked faultlessly following the instructions at the Gallery 2 download site. These use a web based interface to manage the upgrade, including the Gallery database conversion to UTF-8! So if you have set

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

in your Gallery2 config.php, you need to reset it to

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

to allow direct access to the upgrade interface. Then just follow the wizard, remembering to backup your files and databases beforehand, and to set appropriate file permissions wink. After this, just install the Moodle Gallery Module as per your instructions.

At the end of the process revert the Gallery2 config.php to

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

if you wish to limit access to via the Moodle Gallery Module.

Thanks again for your work on this. As UTF-8 database format is recommended for Moodle 1.6 and Moodle 1.7, and will be obligatory for Moodle 1.8, this is a significant update.

Geoff


In reply to Geoffrey Rowland

Re: Gallery2 Integration updated

by Geoffrey Rowland -
Picture of Plugin developers
Hi again

After a little more testing, I have found a problem with backing-up Moodle courses which contain this version of Gallery.

The manual backup stalls at
Include Galleries with user data

I know there have been backup problems with some previous combinations of Gallery and Moodle, and there seem to be quite a few issues with backups of Moodle 1.6.x and other 3rd-party modules, see e.g. this thread.

I presume the Gallery 2 Module backuplib.php needs a bit of a 'tweak', but my PHP/MySQL skills are currently not up to this sad.

Any suggestions?
In reply to Geoffrey Rowland

Re: Gallery2 Integration updated - Backup & Restore

by Geoffrey Rowland -
Picture of Plugin developers
I have identified that at least some of the backup problems with Gallery 2.1.2 are due to changed functions in the Gallery code.

relativeRequireOnce()
seems to have been replaced with requireOnce() and, as noted earlier in this thread, isError() is missing.

There are a number of instances when these are called from /mod/gallery/backuplib.php and /mod/gallery/restorelib.php.

Hope this helps to find a fix




In reply to Geoffrey Rowland

Re: Gallery2 Integration updated - Backup & Restore

by Don Balentine -
Geoffrey

Thanks for pointing those out. Seems in my efforts to get the module going and fixing the layout I left out backups. I'll post a new copy of the backup file tomorrow that corrects the issues and a couple of others I have noticed while browsing the file.

Thanks again

Don
In reply to Don Balentine

Re: Gallery2 Integration updated - Backup & Restore

by Geoffrey Rowland -
Picture of Plugin developers

Cheers Don

For info, in my hands replacing all instances of

relativeRequireOnce()with requireOnce()

and if ($ret->isError()) { with if ($ret) {

in /mod/gallery/backuplib.php and /mod/gallery/restorelib.php seems to have done the trick. Courses containg Galleries backup and restore OK. If the course is restored as a new course, a second copy of the Gallery is created. When deleted, the Gallery is... er... deleted cool.

Since you indicate you have fixed a few more things, I'll wait for your 'official' version rather than attaching copies of my modified files.

In reply to Geoffrey Rowland

Re: Gallery2 Integration updated - Backup & Restore

by Don Balentine -
Geoffrey

Sorry for the delay in getting this updated. I have found an issue with the module that has me a bit baffled. Seems to be a problem with php 5. As best I can tell the module I'm attaching works with php 4. If you have php 5, you will receive an error when restoring the course. I'm going to continue chasing this and hopefully will have it resolved shortly. Until then, I'm attaching my latest update.

Thanks
Don
In reply to Don Balentine

Re: Gallery2 Integration updated - Backup & Restore

by Geoffrey Rowland -
Picture of Plugin developers

This seems to be working for us too (we are using PHP 4.3.9)

Thanks again

Geoff

In reply to Don Balentine

Re: Gallery2 Integration updated - Backup & Restore

by Pedro Crispim -
Don, when do you think this problem with backups is going to be fixed?
I'm using Moodle 1.6.3+ with PHP 5.1.6 and MySQL 5.0.24a in IIS6 (ISAPI).

Thank you
In reply to Pedro Crispim

Re: Gallery2 Integration updated - Backup & Restore

by Don Balentine -
My apologies on my absence here of late. Holiday's become an extremely busy time of year. I have the issue with PHP 5 pinpointed, but I'm still stumped on how to fix it to be honest. I'm still relatively new to php, so some of these items really cause me to stumble. I am working on it and trying to figure out how to fix it. As soon as I have a fix, I will make sure i post it here.
In reply to Don Balentine

Re: Gallery2 Integration updated - Backup & Restore

by Monico Briseño -
Picture of Testers
Don, I just installed the mod gallery in our Moodle 1.6.2 At first glance, it works fine. However, from student point of view the gallery program prints out the following message


Fatal error: Call to a member function on a non-object in /var/www/html/moodle/mod/gallery/locallib.php on line 270

Any idea?

TIA

Mónico
In reply to Monico Briseño

Re: Gallery2 Integration updated - Backup & Restore

by Don Balentine -
Hey Monico

I have tested this on my demo site and all seems to be working ok. Are you using the 10-31-06 copy I have posted here on the forums?

If so, I wonder if this could maybe be a student permissions issue. Double check student permissions and make sure they have rights to view albums.
In reply to Don Balentine

Re: Gallery2 Integration updated - Backup & Restore

by Geoffrey Rowland -
Picture of Plugin developers
Gallery 2.1.2 is pretty much working for us with Moodle 1.6.2+. However, if users try to view a gallery as a (Moodle) guest they get a lovely pink error message:

Gallery User update failed
Error (ERROR_OBSOLETE_DATA) : UPDATE g2_Entity SET g_modificationTimestamp=?,g_serialNumber=? WHERE g_id=? AND g_serialNumber=? (1165434425|3|5|2)
  • in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 374 (gallerycoreapi::error)
  • in modules/core/classes/GalleryStorage.class at line 304 (gallerystorageextras::saveentity)
  • in modules/core/classes/GalleryEntity.class at line 317 (mysqlstorage::saveentity)
  • in modules/core/classes/GalleryUser.class at line 212 (galleryentity::save)
  • in modules/core/classes/GalleryEmbed.class at line 402 (galleryuser::save)
  • in /var/www/html/mod/gallery/locallib.php at line 81 (galleryembed::updateuser)
  • in /var/www/html/mod/gallery/view.php at line 95

I have set up a Gallery user guest with 'View all versions' permissions, and I'm fairly sure this worked with the old version of Gallery . Any ideas? or am I doing something daft.
In reply to Don Balentine

Re: Galler2 Integration updated

by Johan sk4p -
Hi !

Thanks for this module, it's a great tool. Students and teachers go in a lot of places for visiting, now they can put on line pictures !

But I've got a problem before starting its production with teacher accounts...

When they create a new activity and so a new album, no problem ! But after that, no way for them to add pictures inside this album !!!
In fact, the first thing is : they are unable to see albums (and no actions are proposed on the left side...) They just can see album created by the admin (admin works without problem and can see albums created by teachers,add pictures inside...)
I've configured All access for teachers in the moodle configuration panel, it didn't work.
And in addition, even if I put pictures inside albums with admin account, neither students or teachers can see them ("This Album is empty")

Any ideas what can be the problem please ?
Thanks in advance,

Johan

ps : I'm running Moodle 1.6.3 with PHP5,Apache2 and MySQL 5.0.24a on Windows Server 2000, Gallery 2.1.2
In reply to Johan sk4p

Re: Galler2 Integration updated

by Johan sk4p -
I continued to look for what is wrong with my gallery and I found my problem !
It concerns rights. I fixed my problem by configuring "All access" for the teachers group (_MOODLE_TEACHERS_) directly in my Gallery with the admin account. So, now all teachers can manage the gallery entirely.

However, I've still a problem with student account !
I wanted to do the same action I did with teachers, i.e configure directly permissions for the student group (comments and views only) but, for each album, a new group is created, in which students are added when they consult it. So, I need to set up manually, for each new group created, permissions. It's very annoying as you can guess.

Any idea concerning this rights problem ? or how I could automate this task ?

Thanks in advance
In reply to Don Balentine

Version documentation

by Sean Collins -
Don,

I realize you are full on busy and I'm being a bit of a busy-body...

But the version numbers are all over the place. Your 10/31/2006 revision README file says 1.3 2006/10/25 and uses the link for 2.0.4 and the .php file uses the original $module-> version = 2005091600 and v 1.2 2006/10/25.

Currently posted in the module & plugins database, we have version 1.4 2006/04/10 with _its_ associated .php file labeled as v 1.1 2006/03/25.

Couldn't we dispense with the craziness and call your latest revision:

v. 1.5 2006/10/31 (README)
$module->version = 2006103100 (version.php)

...and somehow get this posted to the Modules db?

I've uploaded the above revisions for your perusal.

Cheers,

Sean
In reply to Sean Collins

Re: Version documentation

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Hi Sean,

I think you may be confusing the version numbers at the tops of the files - these are automatically generated by the Source Control system - CVS - these versions relate to the actual file version - not the "module version" - all Moodle Files have version numbers (well most!) - have a look at the cvs here for further examples:
http://moodle.org/mod/resource/view.php?id=126

- so Don doesn't have any "control" over these numbers - they increment every time he or someone else uploads a new version of the file to cvs.

go here for more info on the Moodle CVS:
http://docs.moodle.org/en/CVS_%28developer%29

smile

Dan


In reply to Dan Marsden

Re: Version documentation

by Sean Collins -
Hi, Dan!

Thank you for the clarification. As I read your response, I thought 'ahhhh....'. I had noticed that along with the version and date at the top, there was a _very_ specific time stamp as well. Now I know. The link you provided answered a few other questions I had.

I need just a tad more clarification, though. Version numbers not withstanding, who is responsible for updating the modules & plugins database? I just want to understand. Is it the sole responsibility of the update author or can it also fall under the purview of an administrator? Is it a routinized submission process or a single upload and your done?

There are at least a few examples where the most current file is found only after sifting through the discussion threads when the presumably newest file available doesn't work.

Cheers and thanks again for everyone's time,

Sean
In reply to Sean Collins

Re: Version documentation

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

Hi Sean,

no worries..

anyone can "add" an entry to the modules and plugins database, and they become the "maintainer" of that entry, and have the ability to modify it further, but all the site admins have the ability to modify all the items... - Also when a user adds an entry into the database, one of the admins must "approve" it before it becomes publicly visible.

smile

Dan

In reply to Don Balentine

Album issue

by Jason Hollowell -
Picture of Particularly helpful Moodlers
Don (& all),

I'm really enjoying this integration and, thanks to the help I've received here in the forum, my integration is running quite well.

I have, however, just stumbled onto an issue and wondering if there is a simple solution. I wanted to create an album in Gallery (directly instead of through my Moodle integration) and use that album for a different reason (not related to Moodle) but I just realized that the new album also shows up in my Moodle course that I have installed the integration package in. Is there a way to get only the one album that I intially created to show up in Moodle and other albums created directly from the Gallery admin page to only show up in Gallery? Or do I need to install a separate and unique instance of Gallery for use outside of Moodle?

Thanks again and in advance for any help provided.

Jason