We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38705
    • 101 Posts
    I have succesfully (?) installed the Taxonomies extra. Saw the screencast on youtube and the principle appeals to me very much.
    However i run into some problems.

    The backend stuff seems to work ok. So i am able to create some taxonomies and some terms.
    However if i try to load [[!getPagesByTerm]] nothing "happens" and the following (several duplicate) lines appear in the log:

    [2015-06-26 00:28:17] (ERROR @ /index.php) No class specified for loadClass


    Who has encountered this and solved it? Or does anyone have a clue where to look?

    PS: None of the scripts seem to work.

    This question has been answered by mintnl. See the first response.

      Addict since 2012....
      • 32678
      • 290 Posts
      Quote from: mintnl at Jun 25, 2015, 10:46 PM
      I have succesfully (?) installed the Taxonomies extra. Saw the screencast on youtube and the principle appeals to me very much.
      However i run into some problems.

      Did you ever resolve this? I'm in the same boat with getPagesbyTerm, and have the following three errors from the error log:

      [2015-07-14 13:55:42] (ERROR @ /wpp-redev/index.php) `[[+Page.id]]` is not a valid integer and may not be passed to makeUrl()
      [2015-07-14 13:55:42] (ERROR @ /wpp-redev/index.php) No class specified for loadClass
      [2015-07-14 13:55:42] (ERROR @ /wpp-redev/index.php) Could not load class 


      When including the default class name, this error is produced:

      [2015-07-14 14:02:08] (ERROR @ /wpp-redev/index.php) Error 42000 executing query: SELECT `PageTerm`.`id` AS `PageTerm_id`, `PageTerm`.`page_id` AS `PageTerm_page_id`, `PageTerm`.`term_id` AS `PageTerm_term_id`, `PageTerm`.`seq` AS `PageTerm_seq` FROM `tax_page_terms` AS `PageTerm` WHERE `PageTerm`.`term_id` = ? GROUP BY page_id ORDER BY  LIMIT 6  - Array
      (
          [0] => 42000
          [1] => 1064
          [2] => You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 6' at line 1
      )


      This is on ModX 2.3, mysql 5.5.42, php5.6.7.
        • 38705
        • 101 Posts
        Hi Wpicotte,

        sorry, but no. Tried to reach the creator of the extra but he didnt have the time to investigate further.
        So i switched to the Tagger extra.

        http://modx.com/extras/package/tagger
        https://rtfm.modx.com/extras/revo/tagger

          Addict since 2012....
          • 32678
          • 290 Posts
          Quote from: mintnl at Jul 15, 2015, 05:50 PM
          Hi Wpicotte,

          sorry, but no. Tried to reach the creator of the extra but he didnt have the time to investigate further.
          So i switched to the Tagger extra.

          http://modx.com/extras/package/tagger
          https://rtfm.modx.com/extras/revo/tagger

          Yeah, that's where I wound up, too. What a let-down. ModX needs this badly.
            • 36516
            • 179 Posts
            Either of you guys know how Tagger falls short of Taxonomies? I plan to make myself as useful as possible in the effort to fix this very problem, but if it turns out Tagger is just as good then I suppose there's no point. I imagine it's not quite as good with categories as it might be with tags, though.
              • 41611
              • 7 Posts
              For anyone facing this issue, try this:

              Go to getPagesByTerm snippet, and go to Properties tab. Check if this default properties are set. For me they were not:
              classname: PageTerm
              graph: {"Page":{}}
              sort: pagetitle
              dir: ASC
              


              there is some problem with the installer i suppose..
              • discuss.answer
                • 38705
                • 101 Posts
                Thought I have to give Taxonomies another trie on a new project.
                Thus far i got the snippet to work. Maybe there was some hick-up in php-versions or something a while ago as it seems to for for other people.

                Ha to hack the extra a bit. At first i implemented the pull changes requested by PeteVox here: https://github.com/craftsmancoding/taxonomies/pulls
                After that i checked the var_dump of the sql as proposed by Mark Hamstra somewhere on one of the Taxonomy-topics, there i could see something went wrong with the SQL statement.

                After changing line 45
                $taxonomy_id = $modx->getOption('taxonomy_id',$scriptProperties, null);

                to
                $taxonomy_id = $modx->getOption('taxonomy_id',$scriptProperties,'');


                and line 49 + 50
                $and_where = (is_null($taxonomy_id)) ? '' : 'AND doc.parent = ' . $taxonomy_id;
                 $page_id = (is_null($page_id)) ? $modx->resource->get('id') : $page_id;

                to
                $and_where = (empty($taxonomy_id)) ? '' : 'AND doc.parent = ' . $taxonomy_id;
                $page_id = (empty($page_id)) ? $modx->resource->get('id') : $page_id;


                i got the thing working...

                Maybe it helps someone. However, this extra seems quite dead. It's a shame.
                  Addict since 2012....
                  • 40833
                  • 52 Posts
                  Quote from: mintnl at Apr 04, 2016, 08:11 AM


                  After changing line 45
                  $taxonomy_id = $modx->getOption('taxonomy_id',$scriptProperties, null);


                  Maybe it helps someone. However, this extra seems quite dead. It's a shame.

                  I recently used this extra instead of Tagger because it just makes more sense in the context of taxonomies than Tagger, and offers much more flexibility. I too ran into the error you are speaking of, and I think it has more to do with MODx recently making some changes to their system and the extra not getting updated to compensate. Here is the complete issue that I posted on Github about this problem:

                  Another issue I'm coming across, specifically in the Snippet "getPagesByTerm" is that the $modx->getOption method only returns the default value if the fourth attribute $skipEmpty is set to true. From the official documentation:
                      $default: the value to return when the key was not found.
                      $skipEmpty: when set to true, the $default will also be returned if the $key's value is an empty string. Added in xPDO 2.2.1 / MODX 2.2.0-rc2.
                  

                  This is causing the SQL queries to error since the options values are empty. I'm not sure why the developers at MODx decided to change this feature, but it is a freakin’ time-bomb. It should have been "$doNotSkipEmpty" for backwards compatibility reasons.

                  Anyway, please visit the github page and look at the recent issues for a couple posts I made that might help with some of these issues.
                    • 53178
                    • 24 Posts
                    Quote from: mintnl at Apr 04, 2016, 03:11 AM
                    Thought I have to give Taxonomies another trie on a new project.
                    Thus far i got the snippet to work. Maybe there was some hick-up in php-versions or something a while ago as it seems to for for other people.

                    Ha to hack the extra a bit. At first i implemented the pull changes requested by PeteVox here: https://github.com/craftsmancoding/taxonomies/pulls
                    After that i checked the var_dump of the sql as proposed by Mark Hamstra somewhere on one of the Taxonomy-topics, there i could see something went wrong with the SQL statement.

                    After changing line 45
                    $taxonomy_id = $modx->getOption('taxonomy_id',$scriptProperties, null);

                    to
                    $taxonomy_id = $modx->getOption('taxonomy_id',$scriptProperties,'');


                    and line 49 + 50
                    $and_where = (is_null($taxonomy_id)) ? '' : 'AND doc.parent = ' . $taxonomy_id;
                     $page_id = (is_null($page_id)) ? $modx->resource->get('id') : $page_id;

                    to
                    $and_where = (empty($taxonomy_id)) ? '' : 'AND doc.parent = ' . $taxonomy_id;
                    $page_id = (empty($page_id)) ? $modx->resource->get('id') : $page_id;


                    i got the thing working...

                    Maybe it helps someone. However, this extra seems quite dead. It's a shame.

                    Hi,

                    I got the getPageTerms working following your solution THANK YOU. But the getPagesByTerm snippet is not working. What changes did you pull because that is the step I could not do.