ご利用のサーバ:heteml
Webサーバのバージョン :2.0.xx
PHPのバージョン :5.3
データベースのバージョン :5.0.51a
MODXのバージョン :revolution 2.2.0-pl2-ja
ブラウザ :IE8、Firefox
-----
スニペット・プラグイン
・breacrumbs-1.1.0
・formit-2.0.3
・getfeed-1.0.0
・getresources-1.4.2
・if-1.1
・migx-2.0.0
・phpthumbof-1.3.1
・tinymce-4.3.2
・wayfinder-2.3.2
-----
いつも、お世話になります。
どちら様かお助け下さい。
朝までは、普通にログインもでき、サイトも表示され
スニペット・プラグイン・チャンクも問題なく動作していたのですが、
お昼になってから突然エラーになりました。
その間、どこも変更はしていません。
データベース・FTPにもアクセスできています。
下記が出てログインできません。
どうか、お助け下さい。宜しくお願い致します。
コード: 全て選択
Fatal error: Call to a member function get() on a non-object in /***/core/model/modx/modmanagerresponse.class.php on line 41
コード: 全て選択
<?php
/**
* modManagerResponse
*
* @package modx
*/
require_once MODX_CORE_PATH . 'model/modx/modresponse.class.php';
/**
* Encapsulates an HTTP response from the MODX manager.
*
* {@inheritdoc}
*
* @package modx
*/
class modManagerResponse extends modResponse {
/** @var array A cached array of the current modAction object */
public $action = array();
/**
* Overrides modResponse::outputContent to provide mgr-context specific
* response.
*
* @param array $options
*/
public function outputContent(array $options = array()) {
$action = '';
if (!isset($this->modx->request) || !isset($this->modx->request->action)) {
$this->body = $this->modx->error->failure($this->modx->lexicon('action_err_ns'));
} else {
$action = (integer) $this->modx->request->action;
}
$theme = $this->modx->getOption('manager_theme',null,'default');
$this->modx->lexicon->load('dashboard','topmenu','file','action');
if ($action == 0 || !isset($this->modx->actionMap[$action])) {
/** @var modAction $action */
$action = $this->modx->getObject('modAction',array(
'namespace' => 'core',
'controller' => 'welcome',
));
$action = $action->get('id');
}
$this->action = $this->modx->actionMap[$action];
if (empty($this->action)) $this->action = array();
$isLoggedIn = $this->modx->user->isAuthenticated('mgr');
if (!$isLoggedIn) {
$alternateLogin = $this->modx->getOption('manager_login_url_alternate',null,'');
if (!empty($alternateLogin)) {
$this->modx->sendRedirect($alternateLogin);
return '';
}
$this->action['namespace'] = 'core';
$this->action['namespace_name'] = 'core';
$this->action['namespace_path'] = $this->modx->getOption('manager_path',null,MODX_MANAGER_PATH);
$this->action['lang_topics'] = 'login';
$this->action['controller'] = 'security/login';
} else if (!$this->modx->hasPermission('frames')) {
$this->action['namespace'] = 'core';
$this->action['namespace_name'] = 'core';
$this->action['namespace_path'] = $this->modx->getOption('manager_path',null,MODX_MANAGER_PATH);
$this->action['lang_topics'] = 'login';
$this->action['controller'] = 'security/logout';
}
if ($isLoggedIn && !$this->checkForMenuPermissions($action)) {
$this->body = $this->modx->error->failure($this->modx->lexicon('access_denied'));
} else {
require_once MODX_CORE_PATH.'model/modx/modmanagercontroller.class.php';
/* first attempt to get new class format file introduced in 2.2+ */
$paths = $this->getNamespacePath($theme);
$f = $this->action['controller'];
$className = $this->getControllerClassName();
$classFile = strtolower($f).'.class.php';
foreach ($paths as $controllersPath) {
if (!file_exists($controllersPath.$classFile)) {
if (file_exists($controllersPath.strtolower($f).'/index.class.php')) {
$classPath = $controllersPath.strtolower($f).'/index.class.php';
}
} else {
$classPath = $controllersPath.$classFile;
break;
}
}
/* handle Revo <2.2 controllers */
if (empty($classPath)) {
$className = 'modManagerControllerDeprecated';
$classPath = MODX_CORE_PATH.'model/modx/modmanagercontrollerdeprecated.class.php';
}
if (!file_exists($classPath)) {
if (file_exists(strtolower($f).'/index.class.php')) {
$classPath = strtolower($f).'/index.class.php';
} else { /* handle Revo <2.2 controllers */
$className = 'modManagerControllerDeprecated';
$classPath = MODX_CORE_PATH.'model/modx/modmanagercontrollerdeprecated.class.php';
}
}
ob_start();
require_once $classPath;
ob_end_clean();
try {
$c = new $className($this->modx,$this->action);
/* this line allows controller derivatives to decide what instance they want to return (say, for derivative class_key types) */
$this->modx->controller = call_user_func_array(array($c,'getInstance'),array($this->modx,$className,$this->action));
$this->modx->controller->setProperties(array_merge($_GET,$_POST));
$this->modx->controller->initialize();
} catch (Exception $e) {
die($e->getMessage());
}
$this->body = $this->modx->controller->render();
}
if (empty($this->body)) {
$this->body = $this->modx->error->failure($this->modx->lexicon('action_err_ns'));
}
if (is_array($this->body)) {
$this->modx->smarty->assign('_e', $this->body);
if (!file_exists($this->modx->smarty->template_dir.'error.tpl')) {
$templatePath = $this->modx->getOption('manager_path') . 'templates/default/';
$this->modx->smarty->setTemplatePath($templatePath);
}
echo $this->modx->smarty->fetch('error.tpl');
} else {
echo $this->body;
}
@session_write_close();
exit();
}
/**
* If this action has a menu item, ensure user has access to menu
* @param string $action
* @return bool
*/
public function checkForMenuPermissions($action) {
$canAccess = true;
/** @var modMenu $menu */
$menu = $this->modx->getObject('modMenu',array(
'action' => $action,
));
if ($menu) {
$permissions = $menu->get('permissions');
if (!empty($permissions)) {
$permissions = explode(',',$permissions);
foreach ($permissions as $permission) {
if (!$this->modx->hasPermission($permission)) {
$canAccess = false;
}
}
}
}
return $canAccess;
}
/**
* Gets the controller class name from the active modAction object
*
* @return string
*/
public function getControllerClassName() {
$className = $this->action['controller'].(!empty($this->action['class_postfix']) ? $this->action['class_postfix'] : 'ManagerController');
$className = explode('/',$className);
$o = array();
foreach ($className as $k) {
$o[] = ucfirst(str_replace(array('.','_','-'),'',$k));
}
return implode('',$o);
}
/**
* Get the appropriate path to the controllers directory for the active Namespace.
*
* @param string $theme
* @return array An array of paths to the Namespace's controllers directory.
*/
public function getNamespacePath($theme = 'default') {
/* find context path */
if (isset($this->action['namespace']) && $this->action['namespace'] != 'core') {
/* if a custom 3rd party path */
$paths[] = $this->action['namespace_path'].trim($theme,'/');
if ($theme != 'default') {
$paths[] = $this->action['namespace_path'].'default/';
}
$paths[] = $this->action['namespace_path'];
} else {
$paths[] = $this->action['namespace_path'].'controllers/'.trim($theme,'/').'/';
if ($theme != 'default') {
$paths[] = $this->action['namespace_path'].'controllers/default/';
}
$paths[] = $this->action['namespace_path'].'controllers/';
}
return $paths;
}
/**
* Adds a lexicon topic to this page's language topics to load. Will load
* the topic as well.
*
* @param string $topic The topic to load, in standard namespace:topic format
* @return boolean True if successful
*/
public function addLangTopic($topic) {
$this->modx->lexicon->load($topic);
$topics = $this->getLangTopics();
$topics[] = $topic;
return $this->setLangTopics($topics);
}
/**
* Adds a lexicon topic to this page's language topics to load
*
* @return boolean True if successful
*/
public function getLangTopics() {
$topics = $this->modx->smarty->get_template_vars('_lang_topics');
return explode(',',$topics);
}
/**
* Sets the language topics for this page
*
* @param array $topics The array of topics to set
* @return boolean True if successful
*/
public function setLangTopics(array $topics = array()) {
if (!is_array($topics) || empty($topics)) return false;
$topics = array_unique($topics);
$topics = implode(',',$topics);
return $this->modx->smarty->assign('_lang_topics',$topics);
}
}
サイトのその他のページは、下記エラーが出て表示されません。
コード: 全て選択
Fatal error: Call to a member function getSource() on a non-object in /***/core/cache/includes/elements/modsnippet/11.include.cache.php on line 109
コード: 全て選択
<?php
function elements_modsnippet_11($scriptProperties= array()) {
global $modx;
if (is_array($scriptProperties)) {
extract($scriptProperties, EXTR_SKIP);
}
/**
* getImageList
*
* Copyright 2009-2011 by Bruno Perner <b.perner@gmx.de>
*
* getImageList is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option) any
* later version.
*
* getImageList is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* getImageList; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
* Suite 330, Boston, MA 02111-1307 USA
*
* @package migx
*/
/**
* getImageList
*
* display Items from outputvalue of TV with custom-TV-input-type MIGX or from other JSON-string for MODx Revolution
*
* @version 1.4
* @author Bruno Perner <b.perner@gmx.de>
* @copyright Copyright © 2009-2011
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License
* version 2 or (at your option) any later version.
* @package migx
*/
/*example: <ul>[[!getImageList? &tvname=`myTV`&tpl=`@CODE:<li>[[+idx]]<img src="[[+imageURL]]"/><p>[[+imageAlt]]</p></li>`]]</ul>*/
/* get default properties */
$tvname = $modx->getOption('tvname', $scriptProperties, '');
$tpl = $modx->getOption('tpl', $scriptProperties, '');
$limit = $modx->getOption('limit', $scriptProperties, '0');
$offset = $modx->getOption('offset', $scriptProperties, 0);
$totalVar = $modx->getOption('totalVar', $scriptProperties, 'total');
$randomize = $modx->getOption('randomize', $scriptProperties, false);
$preselectLimit = $modx->getOption('preselectLimit', $scriptProperties, 0); // when random preselect important images
$where = $modx->getOption('where', $scriptProperties, '');
$where = !empty($where) ? $modx->fromJSON($where) : array();
$toSeparatePlaceholders = $modx->getOption('toSeparatePlaceholders', $scriptProperties, false);
$toPlaceholder = $modx->getOption('toPlaceholder', $scriptProperties, false);
$outputSeparator = $modx->getOption('outputSeparator', $scriptProperties, '');
$placeholdersKeyField = $modx->getOption('placeholdersKeyField', $scriptProperties, 'MIGX_id');
$toJsonPlaceholder = $modx->getOption('toJsonPlaceholder', $scriptProperties, false);
$jsonVarKey = $modx->getOption('jsonVarKey', $scriptProperties, 'migx_outputvalue');
$outputvalue = $modx->getOption('value', $scriptProperties, '');
$outputvalue = isset($_REQUEST[$jsonVarKey]) ? $_REQUEST[$jsonVarKey] : $outputvalue;
$docidVarKey = $modx->getOption('docidVarKey', $scriptProperties, 'migx_docid');
$docid = $modx->getOption('docid', $scriptProperties, (isset($modx->resource) ? $modx->resource->get('id') : 1));
$docid = isset($_REQUEST[$docidVarKey]) ? $_REQUEST[$docidVarKey] : $docid;
$processTVs = $modx->getOption('processTVs', $scriptProperties, '1');
$base_path = $modx->getOption('base_path', null, MODX_BASE_PATH);
$base_url = $modx->getOption('base_url', null, MODX_BASE_URL);
$migx = $modx->getService('migx', 'Migx', $modx->getOption('migx.core_path', null, $modx->getOption('core_path') . 'components/migx/') . 'model/migx/', $scriptProperties);
if (!($migx instanceof Migx)) return '';
$migx->working_context = $modx->resource->get('context_key');
if (!empty($tvname)) {
if ($tv = $modx->getObject('modTemplateVar', array('name' => $tvname))) {
/*
* get inputProperties
*/
$properties = $tv->get('input_properties');
$properties = isset($properties['formtabs']) ? $properties : $tv->getProperties();
$formtabs = $modx->fromJSON($properties['formtabs']);
if (!empty($properties['basePath'])) {
if ($properties['autoResourceFolders'] == 'true') {
$scriptProperties['base_path'] = $base_path . $properties['basePath'] . $docid . '/';
$scriptProperties['base_url'] = $base_url . $properties['basePath'] . $docid . '/';
} else {
$scriptProperties['base_path'] = $base_path . $properties['base_path'];
$scriptProperties['base_url'] = $base_url . $properties['basePath'];
}
}
if ($jsonVarKey == 'migx_outputvalue' && !empty($properties['jsonvarkey'])) {
$jsonVarKey = $properties['jsonvarkey'];
$outputvalue = isset($_REQUEST[$jsonVarKey]) ? $_REQUEST[$jsonVarKey] : $outputvalue;
}
$outputvalue = empty($outputvalue) ? $tv->renderOutput($docid) : $outputvalue;
/*
* get inputTvs
*/
$inputTvs = array();
if (is_array($formtabs)) {
//multiple different Forms
// Note: use same field-names and inputTVs in all forms
$inputTvs = $migx->extractInputTvs($formtabs);
}
}
$migx->source = $tv->getSource($migx->working_context, false);
}
if (empty($outputvalue)) {
return '';
}
//echo $outputvalue.'<br/><br/>';
$items = $modx->fromJSON($outputvalue);
$modx->setPlaceholder($totalVar, count($items));
// where filter
if (is_array($where) && count($where) > 0) {
$items = $migx->filterItems($where,$items);
}
if (count($items) > 0) {
$items = $offset > 0 ? array_slice($items, $offset) : $items;
$count = count($items);
$limit = $limit == 0 || $limit > $count ? $count : $limit;
$preselectLimit = $preselectLimit > $count ? $count : $preselectLimit;
//preselect important items
$preitems = array();
if ($randomize && $preselectLimit > 0) {
for ($i = 0; $i < $preselectLimit; $i++) {
$preitems[] = $items[$i];
unset($items[$i]);
}
$limit = $limit - count($preitems);
}
//shuffle items
if ($randomize) {
shuffle($items);
}
//limit items
$tempitems = array();
for ($i = 0; $i < $limit; $i++) {
$tempitems[] = $items[$i];
}
$items = $tempitems;
//add preselected items and schuffle again
if ($randomize && $preselectLimit > 0) {
$items = array_merge($preitems, $items);
shuffle($items);
}
$properties = array();
foreach ($scriptProperties as $property => $value) {
$properties['property.' . $property] = $value;
}
$idx = 0;
$output = array();
foreach ($items as $key => $item) {
$fields = array();
foreach ($item as $field => $value) {
$value = is_array($value) ? implode('||', $value) : $value; //handle arrays (checkboxes, multiselects)
if ($processTVs && isset($inputTvs[$field])) {
if ($tv = $modx->getObject('modTemplateVar',array('name' => $inputTvs[$field]['inputTV']))) {
$inputTV = $inputTvs[$field];
$mTypes = $modx->getOption('manipulatable_url_tv_output_types', null, 'image,file');
//don't manipulate any urls here
$modx->setOption('manipulatable_url_tv_output_types', '');
$tv->set('default_text', $value);
$value = $tv->renderOutput($docid);
//set option back
$modx->setOption('manipulatable_url_tv_output_types', $mTypes);
//now manipulate urls
if ($mediasource = $migx->getFieldSource($inputTV, $tv)) {
$mTypes = explode(',', $mTypes);
if (!empty($value) && in_array($tv->get('type'), $mTypes)) {
//setPlaceholders for sourcePath replacements
$modx->setPlaceholder('mediasource.res_id',$docid);
$value = $mediasource->prepareOutputUrl($value);
}
}
}}
$fields[$field] = $value;
}
if ($toJsonPlaceholder) {
$output[] = $fields;
} else {
$fields['_alt'] = $idx % 2;
$idx++;
$fields['_first'] = $idx == 1 ? true : '';
$fields['_last'] = $idx == $limit ? true : '';
$fields['idx'] = $idx;
$rowtpl = $tpl;
//get changing tpls from field
if (substr($tpl, 0, 7) == "@FIELD:") {
$tplField = substr($tpl, 7);
$rowtpl = $fields[$tplField];
}
if (!isset($template[$rowtpl])) {
if (substr($rowtpl, 0, 6) == "@FILE:") {
$template[$rowtpl] = file_get_contents($modx->config['base_path'] . substr($rowtpl, 6));
} elseif (substr($rowtpl, 0, 6) == "@CODE:") {
$template[$rowtpl] = substr($tpl, 6);
} elseif ($chunk = $modx->getObject('modChunk', array('name' => $rowtpl), true)) {
$template[$rowtpl] = $chunk->getContent();
} else {
$template[$rowtpl] = false;
}
}
$fields = array_merge($fields, $properties);
if ($template[$rowtpl]) {
$chunk = $modx->newObject('modChunk');
$chunk->setCacheable(false);
$chunk->setContent($template[$rowtpl]);
if (!empty($placeholdersKeyField) && isset($fields[$placeholdersKeyField])) {
$output[$fields[$placeholdersKeyField]] = $chunk->process($fields);
} else {
$output[] = $chunk->process($fields);
}
} else {
if (!empty($placeholdersKeyField)) {
$output[$fields[$placeholdersKeyField]] = '<pre>' . print_r($fields, 1) . '</pre>';
} else {
$output[] = '<pre>' . print_r($fields, 1) . '</pre>';
}
}
}
}
}
if ($toJsonPlaceholder) {
$modx->setPlaceholder($toJsonPlaceholder, $modx->toJson($output));
return '';
}
if (!empty($toSeparatePlaceholders)) {
$modx->toPlaceholders($output, $toSeparatePlaceholders);
return '';
}
/*
if (!empty($outerTpl))
$o = parseTpl($outerTpl, array('output'=>implode($outputSeparator, $output)));
else
*/
$o = implode($outputSeparator, $output);
if (!empty($toPlaceholder)) {
$modx->setPlaceholder($toPlaceholder, $o);
return '';
}
return $o;
}