# Error Log: XPDO.php could not load class TaggerTag from mysql.taggertag

**URL:** <https://community.modx.com/t/error-log-xpdo-php-could-not-load-class-taggertag-from-mysql-taggertag/7143>\
**Category:** Random\
**Tags:** extra, revo-3\
**Created:** [October 15, 2023, 5:20pm UTC](https://community.modx.com/t/error-log-xpdo-php-could-not-load-class-taggertag-from-mysql-taggertag/7143 "2023-10-15T17:20:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pixelstuff](https://community.modx.com/letter_avatar_proxy/v4/letter/p/ce73a5/32.png) [@pixelstuff](https://community.modx.com/u/pixelstuff)\
**Post date:** [October 15, 2023, 5:20pm UTC](https://community.modx.com/t/error-log-xpdo-php-could-not-load-class-taggertag-from-mysql-taggertag/7143/1 "2023-10-15T17:20:45Z")

</div>

On a new upgrade to MODx 3.0.4 from MODx 2.8.6, running PHP 8.1, I have many repeat errors in the log saying:

> `.../core/vendor/xpdo/xpdo/src/xPDO/xPDO.php : 667) Could not load class: TaggerTag from mysql.taggertag`

Any idea what could be causing this?

Tagger 2.0.0-pl is installed and seems to be working.

---

<div class="post-metadata">

**Author:** ![halftrainedharry](https://community.modx.com/user_avatar/community.modx.com/halftrainedharry/32/1063_2.png) [@halftrainedharry](https://community.modx.com/u/halftrainedharry)\
**Post date:** [October 15, 2023, 7:05pm UTC](https://community.modx.com/t/error-log-xpdo-php-could-not-load-class-taggertag-from-mysql-taggertag/7143/2 "2023-10-15T19:05:49Z")

</div>

This looks like somewhere the class “TaggerTag” gets used without the namespace (`Tagger\Model\TaggerTag`).

Maybe you have some custom code (e.g. in a snippet) that uses “TaggerTag” and has not yet been adapted to MODX 3.

---

<div class="post-metadata">

**Author:** ![pixelstuff](https://community.modx.com/letter_avatar_proxy/v4/letter/p/ce73a5/32.png) [@pixelstuff](https://community.modx.com/u/pixelstuff)\
**Post date:** [October 15, 2023, 7:49pm UTC](https://community.modx.com/t/error-log-xpdo-php-could-not-load-class-taggertag-from-mysql-taggertag/7143/3 "2023-10-15T19:49:09Z")

</div>

The only custom snippet is one you actually helped me figure out and troubleshoot here:

> [@Best way to create filters like Newegg or B&H Photo](https://community.modx.com/t/best-way-to-create-filters-like-newegg-or-b-h-photo/3451/20):
>
> This is the final code of the snippet. \<?php $tagger = $modx-\>getService('tagger','Tagger',$modx-\>getOption('tagger.core\_path',null,$modx-\>getOption('core\_path').'components/tagger/').'model/tagger/',$scriptProperties); if (!($tagger instanceof Tagger)) return ''; //This section searches based on Tagger words $group\_ids = array(1,2,3,4,5); //The groups to include in the filtering $all\_checked\_tags = array(); $where = array(); foreach($group\_ids as $group\_id){ if (isset($\_GET['filter'.$grou…

I thought I had it upgraded.

Final code ended up being like this:

```auto
<?php
$tagger = null;
try {
    if ($modx->services->has('tagger')) {
        $tagger = $modx->services->get('tagger');
    }
} catch (ContainerExceptionInterface $e) {
    return '';
}
if (!($tagger instanceof Tagger\Tagger)) return '';

$group_ids = array(1,2,3,4,5); //The groups to include in the filtering
$all_checked_tags = array();
$where = array();
foreach($group_ids as $group_id){
    if (isset($_GET['filter'.$group_id])) {
        $tag_ids = $_GET['filter'.$group_id];
        if (is_array($tag_ids)){
            $tag_ids = array_map('intval', $tag_ids);
            $where[] = "EXISTS (SELECT 1 FROM {$modx->getTableName('Tagger\\Model\\TaggerTagResource')} r WHERE r.tag IN (" . implode(',',$tag_ids) . ") AND r.resource = modResource.id)";
            $all_checked_tags = array_merge($all_checked_tags,$tag_ids);
        }
    }
}

$search_value = '';
if (isset($_GET['search'])) {
    $search_value = filter_var($_GET['search'], FILTER_SANITIZE_STRING);
    $min_length_search_value = 3;
    if (mb_strlen($search_value) >= $min_length_search_value){
        $search_value_wildcards = "%" . $search_value . "%";
        $where[] = array("pagetitle:LIKE" => $search_value_wildcards, "OR:b_title:LIKE" => $search_value_wildcards, "OR:b_subtitle:LIKE" => $search_value_wildcards, "OR:b_description:LIKE" => $search_value_wildcards, "OR:b_author:LIKE" => $search_value_wildcards, "OR:b_code:LIKE" => $search_value_wildcards);
    }
}
$modx->setPlaceholder('search_value', $search_value);

//This placeholder is used to preserve the "checked"-state of the checkboxes
$modx->setPlaceholder('filter_tag_ids',$modx->toJson($all_checked_tags));
//This placeholder is used for the getResources subquery
$modx->setPlaceholder('filter_subquery',$modx->toJSON($where));
return '';

```

---

<div class="post-metadata">

**Author:** ![halftrainedharry](https://community.modx.com/user_avatar/community.modx.com/halftrainedharry/32/1063_2.png) [@halftrainedharry](https://community.modx.com/u/halftrainedharry)\
**Post date:** [October 15, 2023, 8:07pm UTC](https://community.modx.com/t/error-log-xpdo-php-could-not-load-class-taggertag-from-mysql-taggertag/7143/4 "2023-10-15T20:07:59Z")

</div>

This snippet doesn’t use the class “TaggerTag”. So it’s unlikely to cause the error message in the log.
