[2015-06-26 00:28:17] (ERROR @ /index.php) No class specified for loadClass
This question has been answered by mintnl. See the first response.
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.
[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
[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 )
Hi Wpicotte,Yeah, that's where I wound up, too. What a let-down. ModX needs this badly.
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
classname: PageTerm graph: {"Page":{}} sort: pagetitle dir: ASC
$taxonomy_id = $modx->getOption('taxonomy_id',$scriptProperties, null);
$taxonomy_id = $modx->getOption('taxonomy_id',$scriptProperties,'');
$and_where = (is_null($taxonomy_id)) ? '' : 'AND doc.parent = ' . $taxonomy_id; $page_id = (is_null($page_id)) ? $modx->resource->get('id') : $page_id;
$and_where = (empty($taxonomy_id)) ? '' : 'AND doc.parent = ' . $taxonomy_id; $page_id = (empty($page_id)) ? $modx->resource->get('id') : $page_id;
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.
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.
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.