##Magento errors and causes
###Error: Not valid template file
CRIT (2): Not valid template file: frontend/base/default/template/path/to/template.phtml
<?php | |
error_reporting(E_ALL); | |
ini_set('display_errors', 1); | |
require_once 'app/Mage.php'; | |
Mage::app(); | |
echo "Testando<br>"; | |
$order = Mage::getModel('sales/order')->loadByIncrementId('100045842'); |
##Magento errors and causes
###Error: Not valid template file
CRIT (2): Not valid template file: frontend/base/default/template/path/to/template.phtml
$ curl -s -o /dev/null -w "Status: %{http_code} Connect: %{time_connect} TTFB: %{time_starttransfer} Total time: %{time_total} \n" www.site-domain.com
Status: 200 Connect: 0,688 TTFB: 1,523 Total time: 2,756
<?php | |
include_once "app/Mage.php"; | |
umask(0); | |
Mage::app()->loadArea('frontend'); | |
$layout = Mage::getSingleton('core/layout'); | |
//load default xml layout handle and generate blocks | |
$layout->getUpdate()->load('default'); | |
$layout->generateXml()->generateBlocks(); |
#!/bin/sh | |
echo "Generate dump?(yes)" | |
read godump | |
if [ $godump = 'yes' ] || [ $godump = 'y' ]; then | |
read -p "mysql user: " YOUR_USER | |
read -p "mysql password: " YOUR_PASSWORD | |
read -p "mysql host: " YOUR_HOST |
<?php | |
/** | |
* A simple fix for a shell execution on preg_match('/[0-9]\.[0-9]+\.[0-9]+/', shell_exec('mysql -V'), $version); | |
* The only edit that was done is that shell_exec('mysql -V') was changed to mysql_get_server_info() because not all | |
* systems have shell access. XAMPP, WAMP, or any Windows system might not have this type of access. mysql_get_server_info() | |
* is easier to use because it pulls the MySQL version from phpinfo() and is compatible with all Operating Systems. | |
* @link http://www.magentocommerce.com/knowledge-base/entry/how-do-i-know-if-my-server-is-compatible-with-magento | |
* @author Magento Inc. | |
*/ |
mysqldump -uUSERNAME -pPASSWORD -hHOSTNAME DATABASE_NAME --single-transaction --opt -R | gzip > dump_database_$(date +%Y-%m-%d:%H:%M:%S).sql.gz |
Magento when you use GROUP BY clause in any Grid.php file in admin, the count always display wrong. Many times it displays 1 even if there are hundreds of records. Due to this your pagination also doesn’t work. This is a bug in Magento. Your getSize() always returns wrong count whereas total records in grid are proper.
To fix this, you need to edit one of your core file. As it’s not a good practice to edit core file, we will here override the core file. Overriding LIB module
Create a rewrite to yout collection main.table:
Mage_[MODULE]Model_Resource[RESOURCENAME]_Grid_Collection
And rewrite getSelectCountSql function with below one:
<?php | |
/** | |
* Error reporting | |
*/ | |
error_reporting(E_ALL | E_STRICT); | |
/** | |
* Compilation includes configuration file | |
*/ |
$ sudo mkdir /var/mysql | |
$ cd /var/mysql | |
$ sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock |