Moodle.org/bugs, not able to log in...

Moodle.org/bugs, not able to log in...

by Marc Dastous -
Number of replies: 3

Ok, I would have submitted this as a bug, but I couldn't get logged in (nor could I get it to send me the correct login information).

I just downloaded and installed 1.4.1 from the download page at Moodle.org.  When I go to admin I get the following error when it tries to register the blocks that I have created:

Warning: array_sum(): The argument should be an array in c:\program files\easyphp1-7\www\blocks\moodleblock.class.php on line 209

It worked fine in Beta, what has changed in the final version that would cause this?  Is there an easy way to fix this?  Does this error have somethig to do with my custom block that creates random inspirational quotes?

Marc

Average of ratings: -
In reply to Marc Dastous

Re: Moodle.org/bugs, not able to log in...

by Marc Dastous -

Solved my own problem thanks to a post by Jon P. that led me in the right direction.

The function applicable_formats array in each of my custom blocks was not updated to the array code.  If you want your old blocks to work in all phases of Moodle, you need to change the function applicable_formats in the block_YOUR_CUSTOM_BLOCK.php to the following:

return array('site' => true);
return array('weeks' =>
true);
return array('topics' =>
true);
return array('social' => true);
 

Just change the options if you only want the block to show up in certain places (ie, return array('weeks' => false); if you don't want the block to show up in the weeks format).

If this is not correct someone please let me know.  I am teaching myself PHP through Moodle.

Marc

In reply to Marc Dastous

Re: Moodle.org/bugs, not able to log in...

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
Its correct, but its even easier to use:
    return array('all ' => true);
if you don't need to prevent it from being displayed in any formats.

mike

In reply to Mike Churchward

Re: Moodle.org/bugs, not able to log in...

by Marc Dastous -

Thanks Mike.  I learn somthing new about PHP everyday, thanks to my friends in the Moodle community big grin

Marc