I’ve tried a variety of ways to add templates and TVs to a package and have them end up in a category. Nothing seems to work.
I tried adding them to the category (this works fine with snippets, plugins, and chunks) with addMany() and the standard attributes array with Children. For Templates, they get added fine, the category saves fine, they end up in the tree -- but uncategorized.
I’m using
xPDOTransport::UNIQUE_KEY => 'templatename'
, which seems right to me.
With TVs, I can’t even get the build script to run:
[2011-02-02 22:25:22] (ERROR) No foreign key definition for parentClass: modTemplate using relation alias: modTemplateVar
With the templates, I’ve tried setting the category in a script resolver. I tried adding the category to each template with addOne(), adding the templates to the category with addMany(), and setting the ID of the category directly with $template->set(’category’,$id) amd $template->set(’category’,’CategoryName’);
.
This code fails to get the category in the script resolver:
$categoryObj = $object->xpdo->getObject('modCategory', array ('category'=>$category));
The category exists (I created it in the build script and it shows in the tree -- all the snippets, chunks, and plugins are categorized under it) and I have it spelled correctly.
Has anyone actually added templates and/or TVs to a category in a transport package -- am I doing something wrong?