This question has been answered by titanium. See the first response.
Sounds odd. The class_key should return 'modDocument', 'modSymLink' or 'modWebLink' for each.The plugin is using the events "OnDocFormSave" and "OnBeforeSaveWebPageCache". But I don't think that this is the cause for the problem.
What event are calling the plug-in on?
Perhaps it's because modResource is the base class?Sorry, I had to correct my previous posting. I'm not sure what "base class" does mean. Do you mean that this is the class of the document the symlink is referencing to? That's true, I think.
class modSymLink extends modResource implements modResourceInterface {
/**
* Overrides modResource::__construct to set the class key for this Resource type
* @param xPDO $xpdo A reference to the xPDO|modX instance
*/
function __construct(xPDO & $xpdo) {
parent :: __construct($xpdo);
$this->set('type', 'reference');
$this->set('class_key', 'modSymLink');
$this->showInContextMenu = true;
}
...
Definitely something odd going on. Looks like a bug to me. Have you tried having one of these linking to another weblink or symlink to see what happens?Here are my findings.
$id = $modx->resource->get('id');
$output = '<p>ID: ' . $id . '</p>';
$classkey = $modx->resource->get('class_key');
$output .= '<p>Class key: ' . $classkey . '</p>';
$object = $modx->getObject('modSymLink',array('id' => 123));
$output .= '<p>' . print_r($object->toArray(), true) . '</p>';
$modx->log(modX::LOG_LEVEL_ERROR, $output, '', __FUNCTION__, __FILE__, __LINE__);
return $output;$classkey = $modx->resource->get('class_key');$resource = $modx->getObject('modResource', array('id' => $modx->resource->get('id')));
$classkey = $resource->get('class_key');