Code update to 5.7
Permalink
I am trying to migrate this code from 5.6 to 5.7. Any suggestions on how to get the available options for a select page attribute?
Loader::model('attribute/type'); $cak = CollectionAttributeKey::getByHandle($attribute_handle); $satc = new SelectAttributeTypeController(AttributeType::getByID($attribute_id)); $satc->setAttributeKey($cak); $values = $satc->getOptions();
The error that I get is:
I've reviewed both of those posts and while there is a lot of good information, I don't see anything about select attributes either in the code on those pages or in the zip file.
Fatal Error: Class 'SelectAttributeTypeController' not found
I've reviewed both of those posts and while there is a lot of good information, I don't see anything about select attributes either in the code on those pages or in the zip file.
did you import the required namespaces? "use.."?
Give this a shot:
use \Concrete\Attribute\Select\Controller as SelectAttributeTypeController;
I was going through the Concrete/core directory and couldn't find anything. Completely missed the Concrete/attributes directory.
Added this to the top of my file and all works now:
Thanks for your help.
Added this to the top of my file and all works now:
use Concrete\Attribute\Select\Controller as SelectAttributeTypeController; use Concrete\Core\Attribute\Type as AttributeType;
Thanks for your help.
You might try looking at the migration guides that Andrew posted if you haven't already:
Part 1:
http://www.concrete5.org/documentation/how-tos/developers/concrete5...
Part 2:
http://www.concrete5.org/documentation/how-tos/developers/concrete5...