Module not found in memory

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
postalservice14
New Member
New Member
Posts: 3
Joined: Thu Aug 13, 2009 11:59 pm

Module not found in memory

Post by postalservice14 »

I am making a module following pretty closely the Skeleton example module(http://viewsvn.cmsmadesimple.org/listin ... k/#_trunk_).  When I submit a form from my 'defaultadmin' page I get this error with debug on.

Notice: Module not found in memory. This could indicate that the module is in need of upgrade or that there are other problems in /var/www/html/cmsadmin/moduleinterface.php on line 109

Anyone know what this means?

Here is my defaultadmin code:

Code: Select all

$files = opendir("/var/www/html/uploads/images/imagerotator");

$db = &$gCms->GetDb();

echo $this->CreateFormStart($id, 'save_admin_prefs', $returnid);
echo '<table width="550" border="0" cellspacing="0" cellpadding="0"><tr>
  <th>Filename</th>
  <th>Alt Tag</th>
  <th>Link</th>
  <th>Display Order</th>
</tr>';
while(($file = readdir($files)) !== false) {
    if(($file != ".") && ($file != "..") && (strpos($file, "thumb_") === false)) {
        $sql = "SELECT * FROM " . cms_db_prefix()."module_sir_images WHERE filename = '$file' ORDER BY sortorder;";
        $dbresult =& $db->Execute($sql);
        if($dbresult) {
            $row = $dbresult->FetchRow();
            echo '<tr>
          <td><input type="hidden" name="id[]" value="'.$row['alt'].'" /><input type="hidden" name="filename[]" value="'.$file.'" /><img src="/uploads/images/imagerotator/'.$file.'" height="50" /><br />'.$file.'</td>
          <td><input type="text" name="alt[]" value="'.$row['alt'].'" /></td>
          <td><input type="text" name="link[]" value="'.$row['link'].'" /></td>
          <td><input type="text" name="sortorder[]" value="'.$row['sortorder'].'" /></td>
        </tr>';
        } else {
            echo '<tr>
          <td><input type="hidden" name="id[]" value="0" /><input type="hidden" name="filename[]" value="'.$file.'" /><img src="/uploads/images/imagerotator/'.$file.'" height="50" /><br />'.$file.'</td>
          <td><input type="text" name="alt[]" value="" /></td>
          <td><input type="text" name="link[]" value="" /></td>
          <td><input type="text" name="sortorder[]" value="" /></td>
        </tr>';
        }
    }
}
echo '<tr><td colspan="4"><br />';
echo $this->CreateInputSubmit($id, 'submit', 'Save');
echo'</td></tr></table>';
echo $this->CreateFormEnd();
Thanks,

John
NaN

Re: Module not found in memory

Post by NaN »

Maybe the skeleton module is not up to date since something has changed in the latest CMS release.
I'm not sure but this could due to the constructor of the skeleton module class (file: skeleton.module.php; function: skeleton()).
If this function is missed create it. (the function must have the same name like the class - wich has the same name like the module name)
In this function there should be something like

Code: Select all

$this->CMSModule();
or

Code: Select all

parent::CMSModule();
and this

Code: Select all

$this->InstalledModules = array();
I've never used the constructor before but this seems to be needed since CMSms 1.6.
postalservice14
New Member
New Member
Posts: 3
Joined: Thu Aug 13, 2009 11:59 pm

Re: Module not found in memory

Post by postalservice14 »

Thanks for the reply.

That didn't seem to change anything.  :-(

I think I'm going to start from scratch again.  Because the Skeleton module works on my CMS installation, which is 1.6.

John
Post Reply

Return to “Developers Discussion”