Create a custom block

Create a custom block

by Andrew Senior -
Number of replies: 4

Hi, I'm attempting to create a custom block for 2.5.1+ and have followed the instructions http://docs.moodle.org/dev/Blocks to create a new block but I get the attached error when trying to upgrade the database. Any ideas?

Thanks

 

Attachment error.jpg
Average of ratings: -
In reply to Andrew Senior

Re: Create a custom block

by ajay sharma -

$plugin->version   = 2013050100;        // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires  = 2013050100;        // Requires this Moodle version

you have to change the $plugin->version(when u change in your block so change this with current date)

you have to change the $plugin->requires(it will change according to moodle version,so search in moodle what willbe use for $plugin->requires  = 2013050100; or u can try same as 2013050100

Average of ratings: Useful (1)
In reply to ajay sharma

Re: Create a custom block

by Andrew Senior -

Thanks for your reply Ajay. I had found the issue and now have my custom block working.

In reply to Andrew Senior

Re: Create a custom block

by Josh Willcock -
Picture of Core developers Picture of Plugin developers

I know this is old, but ^ these replies are so frustrating...  

"I had found the issue and now have my custom block working, It was..."

In reply to Josh Willcock

Re: Create a custom block

by Mario Tomelin -
I had the same error; the issue was a typo in the class name.

The tutorial is working for me, Moodle 2.1.10 (Build: 20130114)