Skip to content

Instantly share code, notes, and snippets.

// Drop this javascript in the page where your grid is - maybe using a .phtml
// in before_body_end or whatever.
$$(".admin-autoemail-adminhtml-rule-index td:contains('Inactive')").each(function(status) {
$(status).up().select('td, a').invoke('setStyle',{ color: '#aaa' });
});
@philwinkle
philwinkle / keybase.md
Last active August 29, 2015 13:57
Keybase.io identity

Keybase proof

I hereby claim:

  • I am philwinkle on github.
  • I am philwinkle (https://keybase.io/philwinkle) on keybase.
  • I have a public key whose fingerprint is 60A1 B554 D364 2133 72FA E6E2 2820 5D5D 3273 2182

To claim this, I am signing this object:

Debugging (Resource) Model Instantiation

Follow each step manually and any bugs during (resource) model instantiation will become obvious.

Since many people find model and resource model instantiation to be one of the more challenging things in Magento 1, these are all the steps Magento does to resolve the factory name to the real PHP class name.

To debug, simply follow each step manually until you find a non-match. This works really well in my experience.
Less guessing, more and faster results.

In the examples I use a factory name of "example/thing".

class Sample_Model_Observer
{
protected $colToAdd = 'colname';
/**
* @param Varien_Event_Observer $observer
*/
public function urapidflow_profile_action( $observer )
{
$action = $observer->getData( 'action' );
$profile = $observer->getData( 'profile' );
@philwinkle
philwinkle / gist:fd3d153b27f7b6da9992
Created August 26, 2014 17:39
PHP 5.4 Dereferencing with an array for a helper
<?php
$__ = array(Mage::helper('yourcompany/helper'), '__');
//usage
echo $__('Translate me');
@philwinkle
philwinkle / election-results.txt
Created September 1, 2015 20:29
2015 Moderator Election Results
OpenSTV version 1.7 (http://www.OpenSTV.org/)
Suggested donation for using OpenSTV for an election is $50. Please go to
http://www.OpenSTV.org/donate to donate via PayPal, Google Checkout, or
Amazon Payments.
Certified election reports are also available. Please go to
http://www.openstv.org/certified-reports for more information.
Loading ballots from file magento-stackexchange-com-2015-election-results.blt.
ytp923p92gjp923galkjew;klajsd;lgjasl;dgjjzij;lkj;lkjl;;¬…¬˚¬˚∆˚∆∆¬∆…øˆp;.lojmu•ºª•¨ª¨¨øˆø¨øjjklła ?:>l,./;;l,kmjn mk,bvhn098765tr4890p8iu7t5r4ety67890-=0p9sgw32g23g /'/
@philwinkle
philwinkle / compare-core-mods.sh
Last active December 12, 2015 05:49
MD5 Comparison snapshot of current Magento release files. Works and tested on OSX, CentOS; though OSX requires md5 instead of md5sum
#!/bin/bash
find app/code/core/Mage app/code/core/Enterprise app/code/core/Zend lib/Varien lib/Mage lib/Zend -type f | grep -v '\.svn' | sort -d -f -k1 | xargs md5sum | awk {'print $2, $1'} > 1.11.2.0.local.md5
diff 1.11.2.0.base.md5 1.11.2.0.local.md5
@philwinkle
philwinkle / Data.php
Created April 14, 2013 00:32
Mage_Autoquote
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php