arambalakjian / DataObject-as-Page

A SilverStripe module for displaying DataObjects as Pages
53 stars 27 forks source link

calling the same function twice #22

Closed lx-berlin closed 11 years ago

lx-berlin commented 11 years ago

Is there a reason why you called getCurrentItem() after another ?

if(($item = $this->getCurrentItem())) { if ($this->getCurrentItem()->canView()) {

otherwise you could just use if ($item->canView())

i found this because i am trying to make a cms , where you can add a DOAP in 9 languages at once. So i need to change a lot. When i got it working i will upload a screenshot :)

thanks for sharing this module !

arambalakjian commented 11 years ago

Wow that sounds interesting!

No reason I know if, I think $item->canView() is how it should be, where abouts was this?

Aram

arambalakjian commented 11 years ago

Ok found and fixed :)