【发布时间】:2014-03-01 04:36:00
【问题描述】:
我在将自定义 Joomla 网站从 Joomla 1.5 升级到 2.5 时遇到了很多问题。我在后端安装了模板,但前端一直显示错误消息。我真的不太了解 PHP,所以我很难弄清楚到底发生了什么。
首先,我使用jupgrade来升级网站的核心。
然后我按照这个视频为 Joomla 2.5 准备了自定义网站模板: http://www.youtube.com/watch?v=xqnm1DJn3jE
在我的“/jupgrade/templates/my-template/menus/ 文件夹中有一个名为 Base.class.php 的文件。
当我尝试转到我网站的新主页时,在 /jupgrade/ 文件夹中,我收到以下错误:
Fatal error: Class 'JParameter' not found in ../public_html/jupgrade/templates/my-template/menus/Base.class.php on line 46
第 46 行内容如下:
function createParameterObject($param, $path='', $type='menu') {
return new JParameter($param, $path); }
根据这个网站 (http://docs.joomla.org/Upgrading_a_Joomla_1.5_extension_to_Joomla_1.6#Converting_Your_JParameters_to_JForms) 我需要将“JParameters”更改为“JForm”。
当我更改它时,我现在在转到主页时收到以下错误:
Catchable fatal error: Argument 2 passed to JForm::__construct() must be an array, string given, called in ../public_html/jupgrade/templates/my-template/menus/Base.class.php on line 46 and defined in ../public_html/jupgrade/libraries/joomla/form/form.php on line 80
form.php文件的第80行是:
public function __construct($name, array $options = array())
{
// Set the name for the form.
$this->name = $name;
// Initialise the JRegistry data.
$this->data = new JRegistry;
// Set the options if specified.
$this->options['control'] = isset($options['control']) ? $options['control'] : false;
}
有人对如何解决这个问题有任何建议吗?
【问题讨论】:
-
当你说“我改变了它”你的意思是你真的只是搜索和替换?
-
尝试将
new JParemeter更改为new JRegistry,因为它已被删除 -
Elin - 是的,我实际上只是换掉了“JParemeter”的任何实例并将其替换为“JForm”。这就是我从上面链接到的文章中的理解。
标签: php joomla joomla2.5 joomla1.5