Topics

Anahita Project

Anahita Project's Topics

Scott Crawford

Scott Crawford

March 18 2017

Rendering an actor bage

I came across this one while trying to add some sidebar content in my articles view.  If the badge of an actor is being rendered through the (at)service call using ids, an error is thrown if the actor being called is somehow otherwise "active" on the view being rendered:

(at)service('com://site/people.controller.person')->ids(1)->view('people')->layout('badge');

So, I'm actor #1 but not logged in and viewing an article that I did not author.  Works fine.  If I log in and view that same article, error is thrown.  Separately, if I remain not logged-in but view an article that I authored the same error is thrown. Again, if not logged in but go back to another article that I did not author, everything works fine again.

Scott Crawford
Scott Crawford
March 18 2017 Permalink
... The error being reported is "Method ComPeopleControllerPerson::__toString() must not throw an exception, caught TypeError: Argument 1 passed to AnDomainEntitysetAbstract::insert() must implement interface KObjectHandlable, array given".
Rastin Mehr
Rastin Mehr
March 18 2017 Permalink
It's not a bug, you need to pass an array for the ids. Although I agree that the controller could become smarter to convert all the passed values to an array. Here is the correct syntax:

Loading ...

You don't have to add the //site to the identifiers anymore since we don't have admin and site anymore.
Unkown Person liked this
Scott Crawford
Scott Crawford
March 19 2017 Permalink
Operator error... still earning my sea legs when it comes to interpreting some of the code base for personally applicable scenarios....
Rastin Mehr liked this
Rastin Mehr
Rastin Mehr
March 19 2017 Permalink
You are doing great and thank you for all the bug reports. Most of them have been legitimate.

Powered by Anahita