Forum

Thread tagged as: Problem

perch_categories() breaks output

I have set up some sets and categories using the Categories app. I can assign categories in Admin and they are shown on the item's page as intended (as tags).

As soon as I am trying to output them on a page as shown in Rachel's video (05:16) with <?php perch_categories(); ?> outputting of the page's content stops without any error message. From perch_categories() on nothing else ist output. I have tried adding 'perch_categories', and 'categories', to config/apps.php, but that does not make any difference.

What am I getting wrong here?

Nils Mielke

Nils Mielke 3 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you show us your apps.php file? How does it compare to the one in the download?

That would be:

<?php
    $apps_list = array(
        'content',
        'categories',
    );

Looks the same as in the latest download. Had to add the categories manually, though, as I upgraded to 2.6 some time ago. Now running 2.6.2

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, that's fine. What error are you getting?

Here's from the error log:
[Thu Aug 28 09:36:26 2014] [error] [client XX.XX.XX.XXX] PHP Fatal error: Using $this when not in object context in .../core/apps/categories/PerchCategories_Categories.class.php on line 102, referer: .../de/unternehmen/training/trainingsangebot.php

Drew McLellan

Drew McLellan 2638 points
Perch Support

We'll get that fixed in today's release.

Nice! Thanks, Drew.