我最近获得了对预先配置的 Drupal 网站的访问权限。我注意到加载特定管理面板的一些问题,所以我最终禁用了 Adaptive Theme -AT Admin 主题。我得到了一个 WSOD,并设法重新启用它,但现在我所有的管理页面都返回此错误:
Fatal error: Cannot redeclare adaptivetheme_admin_preprocess_page() (previously declared in /nas/webroot/mydomain.com/web/dev/themes/adaptivetheme/at_admin/template.php:6) in /nas/webroot/mydomain.com/web/dev/themes/adaptivetheme/at_admin/template.php on line 47
这是它正在谈论的文件:
<?php
/**
* Override or insert variables into page templates.
*/
function adaptivetheme_admin_preprocess_page(&$vars) {
// RFC2822 date format
if ($rfc = date("r" , time())) {
$vars['datetime_rfc'] = t('@time', array('@time' => $rfc));
}
else {
$rfc = '';
$vars['datetime_rfc'] = '';
}
// ISO 8601 date format
if ($iso = gmdate('Y-m-d\TH:i:sO')) {
$vars['datetime_iso'] = $iso;
}
else {
$iso = '';
$vars['datetime_iso'] = '';
}
$vars['content_header_attributes_array']['class'][] = 'branding-elements';
$vars['content_header_attributes_array']['role'][] = 'banner';
}
/**
* Alter the search block form.
*/
function adaptivetheme_admin_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'search_block_form') {
$form['search_block_form']['#title'] = t('Search');
$form['search_block_form']['#title_display'] = 'invisible';
$form['search_block_form']['#size'] = 20;
$form['search_block_form']['#attributes']['placeholder'] = t('Search');
$form['actions']['submit']['#value'] = t('Go');
}
}
function adaptivetheme_admin_preprocess_page(&$vars) {
global $user;
$vars['datetime_rfc'] = '';
$vars['datetime_iso'] = '';
$vars['datetime_rfc'] = date("r" , time()); // RFC2822 date format
$vars['datetime_iso'] = date("c" , time()); // ISO 8601 date format
}
我对 Drupal 管理非常熟悉。我只是想让管理面板再次工作。我尝试刷新所有缓存,但得到一个不同的错误:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 280097 bytes) in /nas/webroot/mydomain.com/web/dev/includes/cache.inc on line 463
我发现如果我通过 SFTP 登录并更改此特定子主题文件夹的名称,我可以进行快速更改。管理员的裸版出现,但在 15 秒左右后返回相同的错误。这让我至少可以重新启用主题,但我不确定为什么它仍然没有加载。