Assigning return value of a module function within a template

Hi there. Long time reader. First time poster.

I've come across something a little odd. When I assign an array in pnuser.php (or another PHP file), I can work with that array as expected within my template. However, if I assign the return value of a module function, for instance, to a variable within a template and that return value happens to be an array, nothing works.

For instance, if I were to do this inside a template that we'll call myshorts.htm...

Code

<!--[pnmodapifunc modname="mymodule" type="user"
func="eatmyshorts" assign="myshorts"]-->


...where the returned value is an array, the result is (apparently) different than if I were to call that same function within pnuser.php and assign it to the template prior to fetching like so...

Code

$pnRender =& new pnRender('mymodule');
$myshorts = pnModAPIFunc('mymodule', 'user', 'eatmyshorts');
$pnRender->assign('myshorts', $myshorts);
$pnRender->fetch('eatmyshorts.htm');


The following would work fine under the second scenario, but fail under the first:

Code

Flavor: <!--[$myshorts.flavor]--><br />
Texture: <!--[$myshorts.texture]--><br />
Bouquet: <!--[$myshorts.bouquet]-->


The same holds true for more complex operations with associative arrays.

Has anyone else experienced this? If so, do you know what causes it?
What do you get returned using pnmodapifunc? Use pndebug to see assigned variables.

--
Under Construction!
Strangely, the variable doesn't appear at all in pndebug. An assigned template variable (a string read in with pnVarCleanFromInput and assigned to a variable within the template) from 3 lines up higher in the template is there and correct, but the variable to which I tried to assign the array isn't there at all. All other relevant variables assigned to the template appear. This one doesn't appear at all. All I can think of is that the routine must return false when you try to pass it an array instead of a string.

I'll dig in a little further to see how it works behind the scenes. Maybe it was simply not designed to handle arrays.
Odd, I have this working in a few places. The plugin 'pnmodapifunc' triggers errors when it returns false. The only diff I can see from your example to mine is that I never quote the attributes... maybe try it with single quotes or no quotes at all...

--
Under Construction!
For fun, I threw the latest PN release candidate on my web server at home and I tried this there. It works...even with the quoted attributes. So, I'm going to stop worrying about it. If it's a bug, it's fixed in 0.8. For my production sites, I'll just work around it like I have been. I've been splitting off the portion of the template that depends on the data from the array into its own file. Then, I've been calling the API function from within a pnuser.php function, assigning it to that new file, fetching it, and then assigning it to a variable passed to the main template. It's a bit cumbersome, but it gets the job done. When 0.8 is released I'm going to have to go through and clean up some database code anyway, so I can undo my work-arounds then.

Thanks for your help. Now I'm off to figure out why li tags are getting changed to h2 tags in a Pagesetter list block. It's always something icon_mad .