Another Block query

Another Block query

David Shields -
回帖数:1

I seem to be having a few 'duh' moments here.

So, I wrote my block, and it sort of works, but when I go to admin, it says

New version of Cover list for 17/05/2006 (cover) exists
Cover list for 17/05/2006 tables have been set up correctly
then shows continue button.

BUT the continue button does nothing - just repeats same page. How do I get moodle to register the changed block and move on ?

Source (if it helps) as follows

<?php
class block_cover extends block_base {
 function applicable_formats() {
  return array('all' => true);
 }
 function instance_allow_multiple() {
  return true;
 }
 function init(){
  // Block to show cover list for today
  if (isteacher()){
   $this->title="Cover list for ".date("d/m/Y");
   $this->version=0.1;
  }
 }
 function get_content(){
  if (isteacher()){
   $this->content = new stdClass;
   $this->content->text = "<a href=\"/internal/moodle2/blocks/cover/cover.php\">Cover list</a>";
   return $this->content;
  }
 }
 
}
?>
回复David Shields

Re: Another Block query

J Rob -
David, did you ever resolve this?

I know that your original post was a long time ago (pre XMLDB?), but I'm encountering the same thing (1.8.3+, Windows Server 2K3, IIS).

I created the db/install.xml location, wrote my table definitions, loaded it from the 'Notifications window', and now I'm getting "New version of ituwork (ituwork) exists
ituwork tables have been set up correctly" and the "Continue" button... and the message never goes away.

Clicking on the Continue button achieves nothing, and the same message is displayed on the Notifications page time after time, even after an IIS restart.

In my attempts to resolve this, I have completely removed the database details from my block (including the db/ directory), and those change are evident from the XMLDB interface, but I still get the same information under 'Notifications'.

Suggestions? Solutions?