wolfcms/wolfcms — pull request #474 by NicNLD (2013-02-13 15:35:58+00:00)
Title: Fixes problems with parent() function

Fixes issue #420.

My explanation, from the forum:

It looks like the problem is that the parent() function uses $this->level to determine the level of the current page. When $this->level is not set, it will be evaluated as 0, causing the function to believe that every page is the Home page. Therefore parent(0) will return the current page and all higher values will return FALSE.

Therefore in wolf/app/models/Page.php, in function parent() all references to $this->level should be replaced by $this->level().

Furthermore,

```php
return $this->parent($level);
```

should be:

```php
return $this->parent->parent($level);
```
Otherwise the function will keep repeating itself endlessly.

(http://www.wolfcms.org/forum/post13522.html#p13522)