Permalink
Browse files

Merge branch 'release-2.0.4-pl2'

* release-2.0.4-pl2:
  [#2502] Fix fatal error with Resources protected by Resource Groups
  Bump version for 2.0.4-pl2 hotfix release
  Fixed issue with resourcelist TV
  • Loading branch information...
opengeek committed Oct 15, 2010
2 parents eff4b1d + e1b999e commit b45aba86b03af18ce13c2ba0a6af2e7d268cab25
View
@@ -2,7 +2,12 @@
This file shows the changes in recent releases of MODx. The most current release is usually the
development release, and is only shown to give an idea of what's currently in the pipeline.
-MODx Revolution 2.0.4-pl
+MODx Revolution 2.0.4-pl2 (October 15, 2010)
+====================================
+- [#2502] Fix fatal error with Resources protected by Resource Groups
+- Fixed issue with resourcelist TV
+
+MODx Revolution 2.0.4-pl (October 14, 2010)
====================================
- Fixed issue where redirect was not working after creating new derivative resource
- [#2485] Fixed issue where placeholder was in duplicated Access Policy
@@ -3,7 +3,7 @@
$v['version']= '2'; // Current version.
$v['major_version']= '0'; // Current major version.
$v['minor_version']= '4'; // Current minor version.
-$v['patch_level']= 'pl'; // Current patch level.
+$v['patch_level']= 'pl2'; // Current patch level.
$v['code_name']= 'Revolution'; // Current codename.
$v['full_version']= $v['version'] . ($v['major_version'] ? ".{$v['major_version']}" : ".0") . ($v['minor_version'] ? ".{$v['minor_version']}" : ".0") . ($v['patch_level'] ? "-{$v['patch_level']}" : "");
$v['full_appname']= 'MODx' . ($v['code_name'] ? " {$v['code_name']} " : " ") . $v['full_version'];
@@ -19,12 +19,12 @@ class modAccessibleObject extends xPDOObject {
public static function _loadInstance(& $xpdo, $className, $criteria, $row) {
$instance = xPDOObject :: _loadInstance($xpdo, $className, $criteria, $row);
if ($instance instanceof modAccessibleObject && !$instance->checkPolicy('load')) {
- $instance = null;
if ($xpdo instanceof modX) {
$userid = $xpdo->getLoginUserID();
if (!$userid) $userid = '0';
$xpdo->log(xPDO::LOG_LEVEL_INFO, "Principal {$userid} does not have permission to load object of class {$instance->_class} with primary key: " . print_r($instance->getPrimaryKey(), true));
}
+ $instance = null;
}
return $instance;
}
@@ -371,6 +371,15 @@ public function getRender($params,$value,array $paths,$method,$resourceId = 0,$t
/* end backwards compat */
$modx =& $this->xpdo;
+ if (empty($modx->resource)) {
+ if (!empty($resourceId)) {
+ $modx->resource = $modx->getObject('modResource',$resourceId);
+ }
+ if (empty($modx->resource) || empty($resourceId)) {
+ $modx->resource = $modx->newObject('modResource');
+ $modx->resource->set('id',0);
+ }
+ }
$output = '';
foreach ($paths as $path) {
@@ -3,19 +3,28 @@
* @package modx
* @subpackage processors.element.tv.renders.mgr.input
*/
-$this->xpdo->lexicon->load('tv_widget');
+$modx->lexicon->load('tv_widget');
$parents = $this->get('elements');
-$bindingsResult = $this->processBindings($this->get('elements'),$this->xpdo->resource->get('id'));
-$parent = $this->parseInputOptions($bindingsResult);
-if (empty($parent)) { $parent = array($this->xpdo->getOption('site_start',null,1)); }
+$bindingsResult = $this->processBindings($this->get('elements'),$modx->resource->get('id'));
+$parents = $this->parseInputOptions($bindingsResult);
+if (empty($parents)) { $parents = array($modx->getOption('site_start',null,1)); }
-/* get parents */
-$parent = explode(',',$parent[0]);
+/* get all children */
+$ids = array();
+$oldContext = $modx->context->get('key');
+$modx->switchContext($modx->resource->get('context_key'));
+foreach ($parents as $parent) {
+ $ids = array_merge($ids,$modx->getChildIds($parent));
+}
+$ids = array_unique($ids);
+$modx->switchContext($oldContext);
+
+/* get resources */
$c = $this->xpdo->newQuery('modResource');
$c->leftJoin('modResource','Parent');
$c->where(array(
- 'modResource.parent:IN' => $parent,
+ 'modResource.id:IN' => $ids,
));
$c->sortby('Parent.menuindex,modResource.menuindex','ASC');
$resources = $this->xpdo->getCollection('modResource',$c);

0 comments on commit b45aba8

Please sign in to comment.