posting attributes to collection index

Permalink
has anyone had trouble getting attributes posted to the collection index table?

The attribute is installed as follows:

$pulln = AttributeType::getByHandle('select'); 
     $somecat=CollectionAttributeKey::getByHandle('some_category'); 
   if( !is_object($somecat) ) {
        CollectionAttributeKey::add($pulln, 
        array('akHandle' => 'some_category', 
        'akName' => t('Some Category'), 
        'akIsSearchable' => '1', 
        'akIsSearchableIndexed' => '1', 
        'akSelectAllowOtherValues' => true, 
        )); 
     }


and then when posting the collection, attribute posted as follows:

$cck = CollectionAttributeKey::getByHandle('some_category');
$cck->saveAttributeForm($p);
$cck->updateSearchIndex();


any ideas?

Chad

RadiantWeb
 
RadiantWeb replied on at Permalink Reply
RadiantWeb
I'll send a free license of your choice of mine to whoever can answer this.

Chad
RadiantWeb replied on at Permalink Reply 2 Attachments
RadiantWeb
K, different question .... I discoverd that the data IS posting...but it's sorta "phantom". see screenshots below. If I edit the field and save, it shows up fine. AKKKKK!!
RadiantWeb replied on at Permalink Reply
RadiantWeb
yup, the server is not seeing the text there. if I edit the table and save it again....the attribute shows up fine.

Any thoughts?
RadiantWeb replied on at Permalink Reply
RadiantWeb
for everyone else' benefit:

Attributes (at least the select attribute) post a "\n" before and after any vars. so with the help of Andrew, it comes out to this:

$category = "\n$this->category\n";
$pl->filterBySomeCategory($category);


cheers! thanks Andrew!