<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Prattski &#124; Magento &#38; Web Development</title>
	<atom:link href="http://prattski.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://prattski.com</link>
	<description></description>
	<lastBuildDate>Mon, 30 Aug 2010 14:17:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Magento:  Event Observer Scope</title>
		<link>http://prattski.com/2010/08/30/magento-event-observer-scope/</link>
		<comments>http://prattski.com/2010/08/30/magento-event-observer-scope/#comments</comments>
		<pubDate>Mon, 30 Aug 2010 14:17:40 +0000</pubDate>
		<dc:creator>Josh Pratt</dc:creator>
				<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://prattski.com/?p=544</guid>
		<description><![CDATA[I learned a valuable lesson this weekend (the hard way of course) when it comes to event observers in Magento. You&#8217;ve got 3 different places to setup your event observers in your config.xml file of your modules. They are as &#8230; <a href="http://prattski.com/2010/08/30/magento-event-observer-scope/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I learned a valuable lesson this weekend (the hard way of course) when it comes to event observers in Magento.  You&#8217;ve got 3 different places to setup your event observers in your config.xml file of your modules.  They are as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;frontend<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;events<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            ...
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/events<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;frontend<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;adminhtml<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;events<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            ...
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/events<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;adminhtml<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;global<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;events<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            ...
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/events<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;global<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>It is pretty self-explanatory, but here&#8217;s how it works:  Events are firing off all the time.  If you are needing to observe an event, but only when it happens on the frontend, then you would put your observer in the &#8216;<frontend>&#8216; section.  That same event might also be fired off in the admin, but your module won&#8217;t observe that event from the admin if you have it in &#8216;<frontend>&#8216;.  If you want the event to be observed no matter where it happens (admin or frontend), you would then put your observer in the &#8216;<global>&#8216; section.</p>
<p>I was trying to observe an event that should be fired off when an order is edited in the admin.  I wasn&#8217;t able to log anything in my observer at all, and I couldn&#8217;t figure out why.  Turns out it was because I had the event observer in the &#8216;<frontend>&#8216; section.  I changed it to &#8216;<adminhtml>&#8216; and then it worked just fine.</p>
]]></content:encoded>
			<wfw:commentRss>http://prattski.com/2010/08/30/magento-event-observer-scope/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento: Adminhtml Theme Setting Change In 1.4.1</title>
		<link>http://prattski.com/2010/08/29/magento-adminhtml-theme-setting-change-in-1-4-1/</link>
		<comments>http://prattski.com/2010/08/29/magento-adminhtml-theme-setting-change-in-1-4-1/#comments</comments>
		<pubDate>Sun, 29 Aug 2010 22:14:34 +0000</pubDate>
		<dc:creator>Josh Pratt</dc:creator>
				<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://prattski.com/?p=539</guid>
		<description><![CDATA[I&#8217;ve been working on a new module today, and I needed to modify a couple different adminhtml templates. So, I did what I usually do and put the following code in my config.xml: &#60;config&#62; ... &#60;stores&#62; &#60;admin&#62; &#60;design&#62; &#60;package&#62; &#60;name&#62;default&#60;/name&#62; &#8230; <a href="http://prattski.com/2010/08/29/magento-adminhtml-theme-setting-change-in-1-4-1/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on a new module today, and I needed to modify a couple different adminhtml templates.  So, I did what I usually do and put the following code in my config.xml:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    ...
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;stores<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;admin<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;design<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;package<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>default<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/package<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;theme<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;default<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>prattski<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/default<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/theme<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/design<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/admin<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/stores<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Then I made my own adminhtml theme folder (app/design/adminhtml/default/prattski/) and put the template files in their proper spot.</p>
<p>No dice.</p>
<p>I was working with 1.4.1.1, so I figured I would just copy my module over to one of my 1.4.0.1 installations and sure enough, it worked perfectly.  So, I&#8217;m not yet sure what the change was, or how to get it to work in 1.4.1 (or if it is just a fluke).  So if you know the details about the change, if there is one, please let me know.  Otherwise, if I figure it out, I will update this post.</p>
]]></content:encoded>
			<wfw:commentRss>http://prattski.com/2010/08/29/magento-adminhtml-theme-setting-change-in-1-4-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento:  Enable Editing Order With Configurable, Grouped, and Bundled Products?</title>
		<link>http://prattski.com/2010/08/28/magento-enable-editing-order-with-configurable-grouped-and-bundled-products/</link>
		<comments>http://prattski.com/2010/08/28/magento-enable-editing-order-with-configurable-grouped-and-bundled-products/#comments</comments>
		<pubDate>Sat, 28 Aug 2010 17:15:08 +0000</pubDate>
		<dc:creator>Josh Pratt</dc:creator>
				<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://prattski.com/?p=536</guid>
		<description><![CDATA[I was working with a friend yesterday who was working on a website that used a lot of grouped products, but also had the need to be able to edit orders in Magento. The bummer thing about Magento and editing &#8230; <a href="http://prattski.com/2010/08/28/magento-enable-editing-order-with-configurable-grouped-and-bundled-products/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was working with a friend yesterday who was working on a website that used a lot of grouped products, but also had the need to be able to edit orders in Magento.  The bummer thing about Magento and editing orders: You can&#8217;t fully do it with configurable, grouped, or bundled products.  It will let you edit the order, but it will not transfer the products over to the new order.  If you try to edit the orders, you will see a warning similar to:</p>
<blockquote><p>This order contains (grouped) items and therefore cannot be edited through the admin interface at this time, if you wish to continue editing the (grouped) items will be removed, the order will be canceled and a new order will be placed.</p></blockquote>
<p>Now here&#8217;s the interesting part that we discovered:  If you add one simple line to app/code/core/Mage/Adminhtml/etc/config.xml, you can kind of get it to work.  Search that file for &#8216;available_product_types&#8217;.  Within that tag, you&#8217;ll find simple and virtual tags.  Add &#8216;<configurable/>&#8216;, &#8216;<grouped/>&#8216;, and/or &#8216;<bundle/>&#8216;  there and save the file.</p>
<p>Now, refresh the order in the admin.  When you click edit, you will no longer receive the same warning, and the products will come over to the duplicated order.  Interesting!</p>
<p>This begs the question: Why doesn&#8217;t Magento have any other product types enabled for editing products besides simple and virtual?  I wonder if there is good reason behind it.  Perhaps adding &#8216;<grouped/>&#8216; above makes it look like it works, but behind the scenes, something is getting messed up?</p>
<p>I have tried this with all three product types.  Here is what I discovered:</p>
<p><strong>Grouped Products:</strong> It seems to work perfectly.  The products come over, and there doesn&#8217;t seem to be any difference in the original order and the duplicated order.</p>
<p><strong>Configurable &#038; Bundled Products:</strong>  It works, but only partially.  The products get transferred to the new order, but the options do not.  The price is accurate, but you are missing the selections made by the user.</p>
<p>Unfortunately, this post is not a solution, but merely a sharing of a discovery.  I wish I had a solid solution to offer.  Configurable, Grouped, and Bundled products are pretty common among the numerous Magento websites that I have seen and developed.  Why Magento hasn&#8217;t yet made editing orders with these product types is a huge question for a lot of Magento users out there.  I can only assume that Magento hasn&#8217;t implemented it yet for a good reason.  Hopefully they will add this functionality soon.</p>
<p><em>As always, I would never suggest editing core files directly.  If you want to experiment making these changes other than just a quick experiment, then create a proper module to do so.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://prattski.com/2010/08/28/magento-enable-editing-order-with-configurable-grouped-and-bundled-products/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cool Mac App Idea?  A Better Log Viewer</title>
		<link>http://prattski.com/2010/08/23/cool-mac-app-idea-a-better-log-viewer/</link>
		<comments>http://prattski.com/2010/08/23/cool-mac-app-idea-a-better-log-viewer/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 02:40:17 +0000</pubDate>
		<dc:creator>Josh Pratt</dc:creator>
				<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://prattski.com/?p=531</guid>
		<description><![CDATA[On my computer, I have a bunch of Magento installs that I work on here and there. I probably have 12 sites on here right now, all being Magento sites. Each Magento install has 2 files that I monitor: var/log/system.log &#8230; <a href="http://prattski.com/2010/08/23/cool-mac-app-idea-a-better-log-viewer/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>On my computer, I have a bunch of Magento installs that I work on here and there.  I probably have 12 sites on here right now, all being Magento sites.  Each Magento install has 2 files that I monitor:  var/log/system.log and var/log/exception.log.  Each of those sites has their own apache error logs as well for any php errors that arise.  That&#8217;s 36 different log files.</p>
<p>I currently run up a <code>tail -f var/log/system.log &#038;</code> in Terminal to monitor files, which works pretty good.  That is my preferred method at this point.  I know that I could also use the Console app, but quite honestly, there&#8217;s no organization there, and there&#8217;s loads of other log files that I don&#8217;t care about.</p>
<p>I think it would be awesome to have a native Mac app that allows you to &#8216;subscribe&#8217; or &#8216;unsubscribe&#8217; from any log files of your choosing, almost like a feed reader (like NetNewsWire).  Here are some features that I think would be really great:</p>
<ul>
<li>Ability to subscribe/unsubscribe easily to any log files on your system</li>
<li>Easily clear the log display (just like command + k in Terminal) or delete everything in the log file</li>
<li>Set filters that look for specific matches (using regex).  If a match is found, the app would notify you in some way (Growl, dock bounce, etc.)</li>
<li>Nice display of log entries (subtle zebra stripe perhaps?  Color-coded, or color icons to easily distinguish between errors, warnings, debug, etc.)</li>
<li>On the logs that you aren&#8217;t currently viewing, show the number of unread log entries for all other logs that you&#8217;ve subscribed to &#8211; just like a feed reader</li>
<li>Ability to organize logs in folders, and rename them (without actually renaming the actual file)</li>
<li>Perhaps some sort of integration with IDE&#8217;s, like Eclipse, Aptana, Netbeans, etc. that would allow you to click on a particular error if there is a file and line number in the log, and it would take you to the error in the file</li>
<li>Ability perhaps to also monitor log files on servers (if proper credentials were given to access them)</li>
</ul>
<p>If you think that this would be a good idea, and something you would be really interested in having, please leave a comment.  Also, if you have any additional ideas that would make this app even more useful, post a comment for that too.</p>
<p>If you would be at all interested in making an app like this, while I do not know cocoa or mac app development, I would love to help in anyway I could.</p>
]]></content:encoded>
			<wfw:commentRss>http://prattski.com/2010/08/23/cool-mac-app-idea-a-better-log-viewer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento:  Learn By Magento&#8217;s Own Examples</title>
		<link>http://prattski.com/2010/08/19/magento-learn-by-magentos-own-examples/</link>
		<comments>http://prattski.com/2010/08/19/magento-learn-by-magentos-own-examples/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 02:42:46 +0000</pubDate>
		<dc:creator>Josh Pratt</dc:creator>
				<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://prattski.com/?p=528</guid>
		<description><![CDATA[I can&#8217;t say it enough: If you are working on Magento programming, you have a gold mine right in front of your face. The best way to create new functionality for Magento is to create a module. But that begs &#8230; <a href="http://prattski.com/2010/08/19/magento-learn-by-magentos-own-examples/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I can&#8217;t say it enough:  If you are working on Magento programming, you have a gold mine right in front of your face.  The best way to create new functionality for Magento is to create a module.  But that begs the questions:  How do I build a module?  What&#8217;s the best way to setup my file/folder structure in my module?  How do I create a table and models for my data?</p>
<p>When you build a module, it typically goes in app/code/local/YourName/YourModule/.  Magento&#8217;s modules live in app/code/core/Mage/ModuleName/.  Your modules should basically follow the same exact format.  So, as of Magento 1.4.1.1, you have <strong>57</strong> different modules to look at as examples.  For most things that you want to be able to do, there is probably a great example somewhere in the core modules for you to learn from and re-factor for your own needs.</p>
<p>If you are going to build modules, then learn how Magento does it and <strong>build them properly!</strong>  I am tired of seeing modules that require a file in itself to be writable (because they didn&#8217;t want to take the time to figure out how to set/get configuration from the database), or &#8220;modules&#8221; that are nothing more than files to be put in the app/code/local/Mage/ directory to directly override core files, or modules that have such jacked up file/folder structure that you can&#8217;t even tell what&#8217;s going on.</p>
<p>Honestly, there is no better method that I have learned Magento development from than looking through the core modules.  You will not regret spending time doing that if you wish to be a better Magento developer.</p>
]]></content:encoded>
			<wfw:commentRss>http://prattski.com/2010/08/19/magento-learn-by-magentos-own-examples/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Magento: Running on Nginx</title>
		<link>http://prattski.com/2010/08/16/magento-running-on-nginx/</link>
		<comments>http://prattski.com/2010/08/16/magento-running-on-nginx/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 13:53:22 +0000</pubDate>
		<dc:creator>Josh Pratt</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[Nginx]]></category>

		<guid isPermaLink="false">http://prattski.com/?p=526</guid>
		<description><![CDATA[Typically, on both my local development environment, and on the servers I deploy most Magento sites on, I am running on the Apache web server. We recently decided to try installing Nginx on a server to see how well it &#8230; <a href="http://prattski.com/2010/08/16/magento-running-on-nginx/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Typically, on both my local development environment, and on the servers I deploy most Magento sites on, I am running on the Apache web server.  We recently decided to try installing <a href="http://nginx.org/">Nginx</a> on a server to see how well it ran Magento.  The results were stunning.</p>
<p>I will probably have more posts on this eventually, so forgive the lack of information in this post.  I just wanted to get the word out there at least that I am extremely impressed with Nginx.  It is blazing fast.  Just today I ran an import of just over 26,000 customer records, and it completed it (importing 5 records at a time) in under 30 minutes.  That&#8217;s fast!</p>
<p>So you may want to check it out if you are interested in a much, much faster server environment for Magento (and for anything else for that matter).</p>
]]></content:encoded>
			<wfw:commentRss>http://prattski.com/2010/08/16/magento-running-on-nginx/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Git: Removing All .svn Files</title>
		<link>http://prattski.com/2010/08/07/git-removing-all-svn-files/</link>
		<comments>http://prattski.com/2010/08/07/git-removing-all-svn-files/#comments</comments>
		<pubDate>Sat, 07 Aug 2010 14:15:45 +0000</pubDate>
		<dc:creator>Josh Pratt</dc:creator>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://prattski.com/?p=513</guid>
		<description><![CDATA[I am just starting to get into git, so I&#8217;m still quite new with it. It definitely seems like it will end up being worth switching from svn to git. I just started up a new Magento project, and the &#8230; <a href="http://prattski.com/2010/08/07/git-removing-all-svn-files/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I am just starting to get into git, so I&#8217;m still quite new with it.  It definitely seems like it will end up being worth switching from svn to git.</p>
<p>I just started up a new Magento project, and the design/skin files that I received from the client were littered with .svn files.  I hadn&#8217;t noticed that at first, so I ended up committing them.  Here&#8217;s what I used to remove them all:</p>
<p><code>find . -type d -name '.svn' -exec git rm -rf {} \;</code></p>
]]></content:encoded>
			<wfw:commentRss>http://prattski.com/2010/08/07/git-removing-all-svn-files/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mysql: Duplicate a Database</title>
		<link>http://prattski.com/2010/08/06/mysql-duplicate-a-database/</link>
		<comments>http://prattski.com/2010/08/06/mysql-duplicate-a-database/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 03:59:38 +0000</pubDate>
		<dc:creator>Josh Pratt</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://prattski.com/?p=509</guid>
		<description><![CDATA[I needed to duplicate one of my mysql magento databases today. Instead of dumping it to my computer, then sending it back into a different database, I figured there&#8217;s got to be a more efficient way to do it. Fortunately &#8230; <a href="http://prattski.com/2010/08/06/mysql-duplicate-a-database/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I needed to duplicate one of my mysql magento databases today.  Instead of dumping it to my computer, then sending it back into a different database, I figured there&#8217;s got to be a more efficient way to do it.  Fortunately there is.  Create the database, then run this from your command line:</p>
<p><code>mysqldump -u [user] --password=[password] databasetodupe | mysql -u [user] --password=[password] newdatabase</code></p>
]]></content:encoded>
			<wfw:commentRss>http://prattski.com/2010/08/06/mysql-duplicate-a-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento Install: Mysql Error &#8211; SQLSTATE[HY000] [2002] No such file or directory</title>
		<link>http://prattski.com/2010/08/05/magento-install-mysql-error-sqlstatehy000-2002-no-such-file-or-directory/</link>
		<comments>http://prattski.com/2010/08/05/magento-install-mysql-error-sqlstatehy000-2002-no-such-file-or-directory/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 02:45:27 +0000</pubDate>
		<dc:creator>Josh Pratt</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://prattski.com/?p=500</guid>
		<description><![CDATA[I recently changed up the configuration of my Mac (running 10.6.4) and I was installing a fresh copy of Magento (1.4.1.1) when I ran into the following error when I got to the database credentials: SQLSTATE[HY000] [2002] No such file &#8230; <a href="http://prattski.com/2010/08/05/magento-install-mysql-error-sqlstatehy000-2002-no-such-file-or-directory/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently changed up the configuration of my Mac (running 10.6.4) and I was installing a fresh copy of Magento (1.4.1.1) when I ran into the following error when I got to the database credentials: SQLSTATE[HY000] [2002] No such file or directory.</p>
<p>I did some Googling around and came across someone that seemed to have a <a href="http://echonull.colinta.com/?p=24">similar issue</a>, though not with Magento.  So I figured I&#8217;d give it a shot.  Well, it worked.  The unfortunate part is that, being not all too familiar with how all this configuration stuff works, I don&#8217;t know why it works (if you know why, please let me know).</p>
<h3>The Solution</h3>
<p>Open up your php.ini file (mine was in /etc/).  Look for the following line:</p>
<pre>pdo_mysql.default_socket=/var/mysql/mysql.sock</pre>
<p>If that line exists for you, try changing it to:</p>
<pre>pdo_mysql.default_socket=/tmp/mysql.sock</pre>
<p>Restart apache after saving, and that&#8217;s all I had to do.  One thing to keep in mind though is that I am using the stock php (with 10.6), and I&#8217;m using mysql installed with homebrew.</p>
]]></content:encoded>
			<wfw:commentRss>http://prattski.com/2010/08/05/magento-install-mysql-error-sqlstatehy000-2002-no-such-file-or-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento: Add Encryption Type When Uploading Files in Admin</title>
		<link>http://prattski.com/2010/08/03/magento-add-encryption-type-when-uploading-files-in-admin/</link>
		<comments>http://prattski.com/2010/08/03/magento-add-encryption-type-when-uploading-files-in-admin/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 18:29:10 +0000</pubDate>
		<dc:creator>Josh Pratt</dc:creator>
				<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://prattski.com/?p=495</guid>
		<description><![CDATA[I am in the process of building a module with a custom interface for some custom data. One thing that it has to do is have the ability to upload an image for each record, very similar to uploading an &#8230; <a href="http://prattski.com/2010/08/03/magento-add-encryption-type-when-uploading-files-in-admin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I am in the process of building a module with a custom interface for some custom data.  One thing that it has to do is have the ability to upload an image for each record, very similar to uploading an image for a category.  I got all the code setup, tested it out and nothing was happening with the image.  Here is how my form element setup looked in the _prepareForm() method:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$form</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Varien_Data_Form<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
    <span style="color: #0000ff;">'id'</span>        <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'edit_form'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'action'</span>    <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getUrl</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'*/*/save'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'id'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getRequest</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getParam</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'method'</span>    <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'post'</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>After looking at it with co-worker of mine, the answer to the problem was quite easy.  Form encryption type.  In order to upload files, you need to have &#8216;multipart/form-data&#8217;, so adding one extra line to the form parameters did the trick:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$form</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Varien_Data_Form<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
    <span style="color: #0000ff;">'id'</span>        <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'edit_form'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'action'</span>    <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getUrl</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'*/*/save'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'id'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getRequest</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getParam</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'method'</span>    <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'post'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'enctype'</span>	<span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'multipart/form-data'</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>So, if you have any modules that deal with uploading files, be sure to add the encryption type to your form.</p>
]]></content:encoded>
			<wfw:commentRss>http://prattski.com/2010/08/03/magento-add-encryption-type-when-uploading-files-in-admin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
