Skip to content

Instantly share code, notes, and snippets.

View Alanaktion's full-sized avatar
:shipit:
Working on too many things.

Alan Hardman Alanaktion

:shipit:
Working on too many things.
View GitHub Profile
@Alanaktion
Alanaktion / magento_url_rewrite.patch
Last active December 5, 2017 18:07 — forked from edannenberg/magento_url_rewrite.patch
Fixes the catalog url rewrite indexer in Magento 1.7.x-1.9.x
diff -rupN mage_org/app/code/core/Mage/Catalog/Model/Url.php src_shop/app/code/core/Mage/Catalog/Model/Url.php
--- mage_org/app/code/core/Mage/Catalog/Model/Url.php 2013-11-19 00:48:25.679009391 +0100
+++ src_shop/app/code/core/Mage/Catalog/Model/Url.php 2013-11-19 00:49:24.188005601 +0100
@@ -643,13 +643,24 @@ class Mage_Catalog_Model_Url
$this->_rewrite = $rewrite;
return $requestPath;
}
+
+ // avoid unnecessary creation of new url_keys for duplicate url keys
+ $noSuffixPath = substr($requestPath, 0, -(strlen($suffix)));
@Alanaktion
Alanaktion / upgrade.php
Last active November 9, 2017 16:36 — forked from colinmollenhour/cleanCache.php
Safely run Magento 1.x upgrade scripts via CLI
<?php
/**
* Set global/skip_process_modules_updates to '1' in app/etc/local.xml and
* then use this script to apply updates and refresh the config cache without
* causing a stampede on the config cache.
*
* It should be placed in the shell/ directory, and must be run via CLI.
*/
if(strtolower(php_sapi_name()) != 'cli'){
exit;