У меня после обновления на 3.2 выскочил белый лист в админке и на фронте. Я пофиксил баги, вызывающие ошибку и все заработало. проблема была в том что в JPlugin (если не ошибаюсь - базовый класс от которого расширяются плагины) не объявлена $app, а в некоторых плагинах она вызывалась через $this->app, что приводило к фатальной ошибке.
При выходе апдейта 3.2.1 я подумал что эти недочеты устранены и обновился, но как оказалось грабли и ныне там где и были. Перелил весь дистрибутив 3.2.1 поверх, не помогло, пришлось снова руками исправлять ошибки. Так у всех или только у меня?
Ошибки:
PHP Fatal error: Call to a member function get() on a non-object in /public_html/plugins/system/remember/remember.php on line 94
PHP Fatal error: Call to a member function checkSession() on a non-object in /public_html/plugins/user/joomla/joomla.php on line 189
PHP Fatal error: Call to a member function getQuery() on a non-object in /public_html/plugins/user/joomla/joomla.php on line 199
PHP Fatal error: Call to a member function isAdmin() on a non-object in /public_html/plugins/authentication/cookie/cookie.php on line 51
Решение для тех кто в таком-же положении:
В плагине remember конструктор должен выглядеть так: (добавлена $this->app = JFactory::getApplication())
public function __construct(&$subject, $config = array())
{
parent::__construct($subject, $config);
$this->app = JFactory::getApplication();
// Use domain and path set in config for cookie if it exists.
$this->cookie_domain = $this->app->get('cookie_domain', '');
$this->cookie_path = $this->app->get('cookie_path', '/');
$this->lifetime = time() + ($this->params->get('cookie_lifetime', '60') * 24 * 60 * 60);
$this->secure = $this->app->isSSLConnection();
$this->length = $this->params->get('key_length', '16');
}
В плагине Joomla и в плагине cookie надо вообще вставить конструктор:
public function __construct(&$subject, $config = array())
{
parent::__construct($subject, $config);
$this->app = JFactory::getApplication();
$this->db = JFactory::getDBO();
}
Я не могу найти такие строки у меня. Вот что у меня
<?php
/**
* @package Joomla.Plugin
* @subpackage System.remember
*
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Joomla! System Remember Me Plugin
*
* @package Joomla.Plugin
* @subpackage System.remember
* @since 1.5
*/
class PlgSystemRemember extends JPlugin
{
/**
* Application object.
*
* @var JApplicationCms
* @since 3.2
*/
protected $app;
/**
* Remember me method to run onAfterInitialise
* Only purpose is to initialise the login authentication process if a cookie is present
*
* @return void
*
* @since 1.5
* @throws InvalidArgumentException
*/
public function onAfterInitialise()
{
// No remember me for admin.
if ($this->app->isAdmin())
{
return;
}
// Check for a cookie if user is not logged in
if (JFactory::getUser()->get('guest'))
{
$cookieName = JUserHelper::getShortHashedUserAgent();
// Check for the cookie
if ($this->app->input->cookie->get($cookieName))
{
$this->app->login(array('username' => ''), array('silent' => true));
}
}
}
/**
* Imports the authentication plugin on user logout to make sure that the cookie is destroyed.
*
* @param array $user Holds the user data.
* @param array $options Array holding options (remember, autoregister, group).
*
* @return boolean
*/
public function onUserLogout($user, $options)
{
// No remember me for admin
if ($this->app->isAdmin())
{
return true;
}
$cookieName = JUserHelper::getShortHashedUserAgent();
// Check for the cookie
if ($this->app->input->cookie->get($cookieName))
{
// Make sure authentication group is loaded to process onUserAfterLogout event
JPluginHelper::importPlugin('authentication');
}
return true;
}
}