Help on creating a module
Posted: 12 October 2007 01:19 PM   [ Ignore ]  
Summer Student
Total Posts:  11
Joined  10-11-2007

I’m new to EE but have about 6 years experience in PHP.  I can do plugins fine, no problem.  I’m using a plugin right now to create extended data for some stuff and storing it in a database, with tools that can be used to edit this data that can be called with EE tags.

Now, this works fine but I would love to make it a module and have the tools being used right in EE with EE’s own control panel. But, every time I try and make a module (editing the Fortunes example, or rather using it as a template) I get the same weird problem.  When I click install, it doesn’t say it installs.  But when I click on “install” again it asks me to uninstall it.  It also doesn’t show the version number.

When I just upload the Fortunes example as-is, I have no problem.  But the minute I rename it (I rename all the proper stuff, the file names, the folder, and the actual classes in the file (this I do with Scite’s find and replace utilities) and try that out I get the same error.

Profile
 
 
Posted: 12 October 2007 02:33 PM   [ Ignore ]   [ # 1 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  08-05-2002

Are you modifying the queries for exp_modules in modulename_module_install() method to have the new class name?

 Signature 
Profile
 
 
Posted: 13 October 2007 10:15 AM   [ Ignore ]   [ # 2 ]  
Summer Student
Total Posts:  11
Joined  10-11-2007

I think so.  Let me check.  If it is and still not working, I’ll post the contents of my install function

Profile
 
 
Posted: 15 October 2007 08:47 AM   [ Ignore ]   [ # 3 ]  
Summer Student
Total Posts:  11
Joined  10-11-2007

Here is the install function:
  function searchvi_module_install()
  {
      global $DB;     
     
      $sql[] = “INSERT INTO exp_modules (module_id,
                            module_name,
                            module_version,
                            has_cp_backend)
                            VALUES
                            (’‘,
                            ‘searchVi’,
                            ‘$this->version’,
                            ‘y’)”;
                           
      $sql[] = “CREATE TABLE IF NOT EXISTS `exp_vidata` (  `id` int(11) NOT NULL auto_increment,  `bedrooms` int(11) NOT NULL default ‘0’,  PRIMARY KEY (`id`) ) ;”;
 
      foreach ($sql as $query)
      {
        $DB->query($query);
      }
     
      return true;
  }

Profile
 
 
Posted: 15 October 2007 09:33 AM   [ Ignore ]   [ # 4 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  08-05-2002

That class name is not following the Developer Guidelines for Class Naming

 Signature 
Profile
 
 
Posted: 15 October 2007 10:06 AM   [ Ignore ]   [ # 5 ]  
Summer Student
Total Posts:  11
Joined  10-11-2007

That was it!  Thanks.  The actual class was named properly, but not the one mentioned in INSERT.

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 65026 Total Logged-in Users: 42
Total Topics: 82116 Total Anonymous Users: 18
Total Replies: 441305 Total Guests: 189
Total Posts: 523421    
Members ( View Memberlist )
Newest Members:  meenoiYang.JianuoioitsukiNathan HammondalexcigadamstaneckiLucas Mayscybermilltstitt