Hi,
I’ve had MODx 2.0.8 installed for several months as we built a site and are now allowing the client to login and populate around 135 resources. The site has performed normally until this weekend when the client reported the following issues:
Frontend home page: Fatal error: Maximum execution time of 30 seconds exceeded in C:\inetpub\vhosts\actrained.com\httpdocs\core\model\modx\modcachemanager.class.php on line 137
Manager: most elements load but Resources/Elements/Files document tree remains empty. Expanding root level will show animated ’loading icon’ but no content comes in and script times out after 30 sec trying to load:
http://domain.draftwebsite.co.uk/connectors/browser/directory.php?action=getList&id=/
phpMyAdmin reports no corrupted tables. I tried clearing the MODx cache but this makes no difference. Changing the server between PHP via ISAPI/CGI/FastCGI makes no difference. MODx Error Log has no entries since 13 July relating to ’skipping duplicate resource alias’ which I first presumed is irrelevent but see the code excerpt below. allow_duplicate_alias is set to No and friendly_urls is set to Yes.
I considered upgrading to the latest version but as some of the packages are not on the latest versions I don’t want to risk this and am not keen to try to install the latest versions in case this timeout issue prevents this being done correctly.
I tried disabling the cache via the Manager but this makes no difference.
Can anyone suggest what to look at or if I could maybe import the database into a clean install of Revolution 2.0.8?
Thanks,
Chris
Extract from modxcachemanager.class.php is:
Looking at line 137 where the error occurs it appears to be looping through resource aliases.
if ((isset ($obj->config['friendly_urls']) && $obj->config['friendly_urls']) || $contextConfig['friendly_urls']) {
if ((isset ($obj->config['friendly_alias_urls']) && $obj->config['friendly_alias_urls']) || $contextConfig['friendly_alias_urls']) {
$resAlias= $r->alias;
if (empty ($resAlias)) $resAlias= $r->id;
$parentResource= '';
if ((isset ($obj->config['use_alias_path']) && $obj->config['use_alias_path'] == 1) || $contextConfig['use_alias_path']) {
$pathParentId= $parentId;
$parentResources= array ();
$currResource= $r;
$parentSql= "SELECT {$resourceCols} FROM {$tblResource} `r` WHERE `r`.`id` = :parent AND `r`.`id` != `r`.`parent` LIMIT 1";
$hasParent= (boolean) $pathParentId;
if ($hasParent) {
if ($parentStmt= $this->modx->prepare($parentSql)) {
$parentStmt->bindParam(':parent', $pathParentId);
if ($parentStmt->execute()) {
while ($hasParent && $currResource= $parentStmt->fetch(PDO::FETCH_OBJ)) {
$parentAlias= $currResource->alias;
if (empty ($parentAlias))
$parentAlias= "{$pathParentId}";
$parentResources[]= "{$parentAlias}";
$pathParentId= $currResource->parent;
[b]$hasParent= ($pathParentId > 0 && $parentStmt->execute()); <<<<<<<<< line 137[/b]
}
}
}
}
$resPath= !empty ($parentResources) ? implode('/', array_reverse($parentResources)) : '';
}
} else {
$resAlias= $r->id;
}
if (!empty($containerSuffix) && $r->isfolder) {
$resourceExt= $containerSuffix;
} else {
$resourceExt= $contentType->getExtension();
}
if (!empty($resourceExt)) {
$resAlias .= $resourceExt;
}
} else {
$resAlias= $r->id;
}
Environment details are below.
Web Server:
* PHP version and how it’s running (suexec, mod_php, CGI, etc.) - PHP Version 5.2.13, FastCGI
* Apache or IIS version - IIS v7.5
* Operating System and version - Windows Server 2008 R2 Standard
Database:
* MySQL version - 5.1.51 Community
* List of any tables over 1MB in size - none
MODx:
* Version - MODx Revolution 2.0.8-pl (traditional)
* Any changes you’ve made - none other than installing some packages
* Any snippets you’re running on the page that is not working properly
* Any plugins you’re running - archivist 1.1.0, batcher 1.1.0, breadcrumbs 1.1, codemirror 2.0.0,
getpage 1.0.0, getresources 1.3.0, googlesitemap 1.2.1, if 1.1, quickcrumbs 1.0.0, simplesearch
1.4.0, taglister 1.1.3, tinymce 4.2.3, wayfinder 2.3.1
Browser/Client:
* Browser name and version - Firefox 3.6.18
* Operating System and version - Windows 7 64bit