Forum

Thread tagged as: Problem, Addons, Members

perch_member_has_tag

I am trying to get perch_member_has_tag working but it always returns false. I couldn't find has_tag in the codebase, I wonder if it has been removed. Could someone check?

Code: if (perch_member_logged_in()){ if (perch_member_has_tag('registered')) { echo "<p>Has Tag</p>"; } else { echo "<p>No Tag</p>"; } }

Always displays No Tag

db: tagID : tag : tagDisplay 2 : registered : Registered 3 : consortium-member : Consortium Member

Member has both tags. This is confirmed in the admin site and I can also see that the member has both tags set correctly in the perch_members_member_tags association table.

Diags:

Health check

Perch is up to date
PHP 5.5.9-1ubuntu4.11 is up to date
MySQL 5.5.43-0ubuntu0.14.04.1 is up to date
Image processing available

Summary information

Perch: 2.8.26, PHP: 5.5.9-1ubuntu4.11, MySQL: 5.5.43, with PDO
Server OS: Linux, apache2handler
Installed apps: content (2.8.26), assets (2.8.26), categories (2.8.26), perch_members (1.4.2)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_members' );
PERCH_LOGINPATH: /perch
PERCH_PATH: /var/www/euro/eurowabb/perch
PERCH_CORE: /var/www/euro/eurowabb/perch/core
PERCH_RESFILEPATH: /var/www/euro/eurowabb/perch/resources
Image manipulation: GD
PHP limits: Max upload 16M, Max POST 8M, Memory: 128M, Total max file upload: 8M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
HTTP_HOST: localhost
DOCUMENT_ROOT: /var/www/euro/eurowabb/
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Dave Mellett

Dave Mellett 0 points

  • 5 years ago

Silly question... is member marked as Active? Also, have you logged the member out and logged back in?

EDIT: BTW, perch_member_has_tag() method is in perch_members/runtime.php

Thankyou Robert, logging out and back in did the trick. I probably added the tags in admin while the user was logged in so it hadn't picked them up. So problem solved!