Grid format breaks course

Grid format breaks course

by Doug Cullen -
Number of replies: 26

Rats.

I tested the grid format on my shared server and it worked fine.  Installed it on my server at school, it tried to create a course using Grid format and bang

Notice: Undefined property: stdClass::$students in /afs/csl.tjhsst.edu/web/www/studentlife/activ/nhs/course/format/grid/format.php on line 21

Moodle 2.1.3(build 20111128) on both and used the same download for Grid Format. 

So i decided to delete the new course. BUT, it doesn't delete from the front page and it still in the new/edit course menu.

If I enter the course I get the same error message, plus "insert_record() isn't available anymore"  so it looks like its half way deleted.

I really like the way grid works, but I'm baffled as to why its only broke on one installation.

I'm also baffled about how to really kill the botched up course.

 

Thanks in advance

Doug

 

Average of ratings: -
In reply to Doug Cullen

Re: Grid format breaks course

by Gideon Williams -
Ours installed fine at school but we had synergy do it for us BIG PROBLEM is that you then cannot delete any courses in any format as a result!!!!!!!!
In reply to Gideon Williams

Re: Grid format breaks course

by Doug Cullen -

So I've discovered.  There appears to be an error in the delete code.  Turning on debugging yields the following error

Fatal error: Cannot redeclare callback_topics_uses_sections() (previously declared in /home/dcullen7/public_html/M21/course/format/grid/lib.php:33) in /home/dcullen7/public_html/M21/course/format/topics/lib.php on line 34

I really hope these acan be fixed, It really is ideal for my purposes.

 

 

 

In reply to Doug Cullen

Re: Grid format breaks course

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Doug,

As I discovered when updating my Collapsed Topics format, the function names in lib.php need to be changed to match the directory name of the format, i.e: callback_formatdirname_..... This should solve your problem.

Also, try changing the format of the course to the standard 'topics' one in the course administration, then attempt to delete it.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Grid format breaks course

by Gideon Williams -
Im interested you mention this idea of changing back the format to topics before deleting as this does not work for us and we still have problems?
In reply to Gideon Williams

Re: Grid format breaks course

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Gideon,

I just tried removing a course in Moodle 2.1.3+ (Build: 20111201) in both 'Grid' and 'Weekly' formats and it does not appear to work.  So they have to be removed manually in the DB by removing their entry in course (but note down the ID), then any entries in the following for that 'id': course_sections, log and user_access.

Please try on a test server first as I'm not an expert in this.

Additionally you will have to remove or remove entries in 'format_grid_icon' and 'format_grid_summary' that the grid format creates.

Cheers,

Gareth

 

In reply to Gareth J Barnard

Re: Grid format breaks course

by Gideon Williams -

Thanks so much for going to all this trouble Gareth - a real aid to us. Am hoping though that they get this sorted.

The Grid format and Slide format are proving really popular at school to counteract the "scroll of death".

Cheers

Gid

In reply to Gideon Williams

Re: Grid format breaks course

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Gideon,

No worries.  Have you tried my 'Collapsed Topics' course format to solve the 'scroll of death'? - plug ;)

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Grid format breaks course

by Gideon Williams -

A plug may be, but said in the nicest of ways!

No I have not but I will explore this weekend

 

Gid

In reply to Doug Cullen

Re: Grid format breaks course

by Craig Mackey -

We also installed the the latest Grid format onto our recently upgraded site (2.1.3+) and have had issues. The module installed into moodle ok, then a few days later it was used in a very simple course. Coincidently Apache then crashed and wouldn't restart until the Grid format folder was deleted from the ....\course\format\   directory. Unfortunately the system crashed last Friday afternoon so we lost a whole weekend until Monday when our tech's returned to work.

This format looks so promising, can we plese have an updated version that is fully compatable with 2.1 then 2.2.

In reply to Craig Mackey

Re: Grid format breaks course

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Craig,

Have you contacted Julian (http://moodle.org/plugins/view.php?plugin=format_grid) about the issues?  He is a Moodle 'Guru'.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Grid format breaks course

by Gideon Williams -

Im afraid that we have removed this format for good in our Moodle. Installed and reinstalled it twice, but causes huge problems with deleting of other courses even if you turn them back into Topic Format.

Support team getting a bit annoyed.

Very disappointed as huge potential but just not working reliably.

In reply to Gideon Williams

Re: Grid format breaks course

by Karim Waljee -

So as it turns out i've contacted the Julian and opened up a tracker for this issue.

Soon after I did this I went through  the "lib.php" within the grid folder. I believe I fixed the problem.

What was happening was that the string being returned was "topics" I changed these to "grid" and I was able to delete courses/categories/subcategories again. I am using Moodle 2.0.3.

Take extreme caution though as I'm not the strongest of programmers. Although, I have tested it on my server and everything seems fine. I have attached the new lib file in this post. Place it in your .course/format/grid folder. Make a backup of the original lib file before you place this one on the server.

I am still awaiting Julian to respond regarding this (or make comments to the tracker).

Here is to hoping!

Cheers,

Karim

Average of ratings: Useful (2)
In reply to Karim Waljee

Re: Grid format breaks course

by Julia Küfner -

Hi Karim,

thanks for your patch! Hope Julian will add it to the current version soon!

In reply to Julia Küfner

Re: Grid format breaks course

by Karim Waljee -

No Problem Julia,

Let me know how it works out for you.


Cheers,

Karim

In reply to Doug Cullen

Re: Grid format breaks course

by Julian Ridden -

We have made some major updates to the code today. Please grab the latest from https://github.com/PukunuiAustralia/moodle-courseformat_grid and your reported issues should dissapear.

This latest version no longer generates errors with debug turned on. It has been tested in Moodle 2.0, 2.1 and 2.2.

Julian

In reply to Julian Ridden

Re: Grid format breaks course

by Craig Mackey -

Julian,

I just downloaded and installed your grid view course format and installed it into a test course on my prototype site (moodle 2.1.3 using Krystle2 theme) and it seems to work well.

However when I place section 0 into the grid, then select an image for it the New Activity ribbon remains across my image. Otherwise the format is really easy to use and set up. Well done.

Is it possible to have an option to increase the number of columns to 3 or 4?

Thanks for the great layout. This really simplifies setting up a graphic frontpage for the course.

Regards,
Craig.

asdf

In reply to Craig Mackey

Re: Grid format breaks course

by John Ryan -

A really useful looking format.  Just downloaded from the Moodle plugins and very surprised to see that Gareth Barnard's comment of Dec 2 still hasn't made it into the code fr download.

He said :

"As I discovered when updating my Collapsed Topics format, the function names in lib.php need to be changed to match the directory name of the format, i.e: callback_formatdirname_..... This should solve your problem."

I've just changed all references to "topics" to "grid" in lib.php and my moodle 2.0.7 system will happily delete courses whereas before the edit it falled with the cannot redeclare function error.

Craig mentions above that he moved section 0 into the format.  How do you do that? (is it a 2.1 thing?)

In reply to John Ryan

Re: Grid format breaks course

by John Ryan -

Just downloaded from the git repository Julian mentioned above and the changes have been made to the lib.php files.

However, now I find that the images only appear in a single column.

In reply to John Ryan

Re: Grid format breaks course

by imbu danilot -

yup, same here, courses appear in a single column.... thoughtful

In reply to imbu danilot

Re: Grid format breaks course

by imbu danilot -

Hello,

discard my previous comment, I used the copy available at

http://moodle.org/plugins/view.php?plugin=format_grid

(the official plugin link, that is)

and that works a lot better, it does not show many issues at least from the graphic perspectives.

I shall test it further.

the problems I had were due to that fact that I started downloading copies reported in the comments of the same link, discard those links are old and temporary releases which are broken

cheers

Imbu

In reply to imbu danilot

Re: Grid format breaks course

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

I just installed the 'master' branch in the latest Moodle 2.2.1 (Build: 20120213) and get...

Attachment grid_22.png
In reply to Gareth J Barnard

Re: Grid format breaks course

by Nikki Macfarlane -

I have just tried to install this in to a stable version of Moodle 2.2 with a standard theme and get the following error. Any ideas on how to fix this? Seems several people have had the same problem but I cannot find a solution. I have tried the code in the plugins directory as well as from github and have the same problem with each version. It seems to be unable to find the function insert_record() but I cannot figure out where that function is supposed to be! I do use blocks in my courses - could this be causing the problem?

insert_record() not available anymore

Debug info: error() is a deprecated function, please call print_error() instead of error()
Stack trace:
  • line 831 of /lib/deprecatedlib.php: moodle_exception thrown
  • line 1796 of /lib/deprecatedlib.php: call to error()
  • line 114 of /course/format/grid/format.php: call to insert_record()
  • line 252 of /course/view.php: call to require()

Thanks,

Nikki

In reply to Nikki Macfarlane

Re: Grid format breaks course

by Julian Ridden -

I have just pushed a new version to Github. Please grab the latest copy and let me know if you still ave issues.

In reply to Julian Ridden

Re: Grid format breaks course

by Nikki Macfarlane -

This is perfect thanks Julian! Works a treat on Moodle 2.2 with my theme (Superfresh). I have to do some work on the stylesheet as the list items are appearing in one column but that shoudl be easy. Thank you so much!

Nikki

In reply to Julian Ridden

Re: Grid format breaks course

by Carlos Sánchez Martín -

Hello Julian,

Thank you for taking the time to update the grid format. After installing the latest version, all errors apparently disappear, which is good news!

On the other hand, links to pictures part of the "topic summary" still disappear (they become broken links) when switching from "topics format" to "grid format". Interesting to notice that if the picture is in a label, it does not disappear.

Last comment, after installing "grid format" I tried to restore a course, and I wasnt't able to do it, getting the following error:

"Restore method process_grid is missing. It must be defined by a developer."

I also printed a long "More information about this error: Stack trace & Output buffer" info. If you think that it could be helpful to look at it, I can send you all error lines printed.

Un saludo,
Carlos