No attribute types in drop down box

Permalink
Hi,

I am creating a custom package and have managed to use the attribute model pretty well however where I would normally see a list of attribute types (select, text, date etc) in the drop down to "Add Attribute" I am seeing nothing.

I have this in my model:
public static function getList($filters = array()) {
      $list = parent::getList('frankjobs', $filters);   
      usort($list, array('FrankjobsAttributeKey', 'sortListByDisplayOrder'));
      return $list;
   }


And this in my controller:

public function __construct() {
      parent::__construct();
      $otypes = AttributeType::getList('frankjobs');
      $types = array();
      foreach($otypes as $at) {
         $types[$at->getAttributeTypeID()] = $at->getAttributeTypeName();
      }
      $this->set('types', $types);
   }


And this in the view:

<?php echo $form->select('atID', $types)?>


Am I missing something somewhere? Do I have to specify somewhere what type are allowed? I want them all really.

Thanks in advance!

 
beingalex replied on at Permalink Reply
It seems that when the package is getting installed it is not populating AttributeTypeCategories with the Atrribute Type ID and the Category ID.

Has anybody else experienced this?
beingalex replied on at Permalink Best Answer Reply
Fixed it with this in my install method:

// install Attribute Category
        $allowSets = false;
        $akc = AttributeKeyCategory::add('frankjobs', $allowSets, $pkg); 
        //associate default Attribute Types to be used with this new attribute category
        for($i=1; $i<9; $i++) {
            $akc->associateAttributeKeyType(AttributeType::getByID($i));
}