Trouble installing a custom package

Permalink
Hello everyone,
I am having some issues getting my package to install correctly. I have attached a screenshot of my directory structure... Currently I can see the package under "Awaiting Installation" but when I click install the page just refreshes and nothing is actually installed. So here is my code:

Block "duas_new_event":
Controller.php
<?php
   defined('C5_EXECUTE') or die("Access Denied.");
   class DuasNewEventBlockController extends BlockController {
      protected $btTable = "btDuasEvents";
      protected $btInterfaceWidth = "350";
      protected $btInterfaceHeight = "350";
      public function getBlockTypeDescription() {
         return t("This is a block custom designed");
      }
      public function getBlockTypeName() {
         return t("DUAS - New Event");
      }         
   }
?>


db.xml
<?xml version="1.0"?>
<schema version="0.3">
    <table name="btDuasEvents">
          <field name="bID" type="I">
             <key></key>
             <unsigned></unsigned>
          </field>
        <field name="event_id" type="I">
            <autoincrement></autoincrement>
            <unsigned></unsigned>
        </field>
        <field name="event_name" type="C" size="45"></field>
        <field name="event_type" type="C" size="45"></field>
        <field name="event_date" type="T"></field>
        <field name="bro_id" type="I"></field>


Package controller.php
<?php
   class DuAttendanceSystemPackage extends Package {
      protected $pkgHandle = 'DuAttendanceSystemPackage';
      protected $appVersionRequired = '5.6';
      protected $pkgVersion = '0.3';
      public function getPackageDescription() {
         return t("This is a package custom designed");
      }
      public function getPackageName() {
         return t("DU Attendance System"); 
      }
      public function install() {
         $pkg = parent::install();
         BlockType::installBlockTypeFromPackage('duas_new_event');
      }


Any help would be appreciated, thank you!

1 Attachment

cecil4
 
mesuva replied on at Permalink Reply
mesuva
The only thing that I can spot is that the line in your package controller that installs the block isn't passing in a reference to the package.

So instead of:
BlockType::installBlockTypeFromPackage('duas_new_event');


I'd normally put:
BlockType::installBlockTypeFromPackage('duas_new_event', $pkg);
cecil4 replied on at Permalink Reply
cecil4
Thanks for the help! I passed in my package but that didn't seem to fix the issue. Any other suggestions?
cecil4 replied on at Permalink Best Answer Reply
cecil4
I fixed the issue, I had the package handel ($pkgHandle) to the name of the parent package directory. Thank you for y'alls help!