-
Posts Tagged ‘Drupal’
Knowledge Nuggets
Friday, January 20th, 2012 by Christian MattixAnyone who has done development, design, or IT knows that over the course of working on a project, you collect various “nuggets” of knowledge that you ever learn or find. Here I’m going to share some of what I’ve discovered that may be able to help you in your own projects. I have cited the original source of the information if I have that available. If there is something that I’ve left out, feel free to add it in the comments.
“Fatal error: Out of memory…” occurring when PHP and Apache memory limits seem fine
This problem drove me crazy for a little while. I did everything that I thought I needed to do, I changed the php.ini file to increase the php memory available until I ran across this link which provided the answer. We are using WiredTree as our hosting provider, for their servers, the problem was fixed by simply adding:
RLimitMem 128000000to the .htaccess file in the www root directory. After doing this, it fixed everything.I keep getting Notice: Undefined offset: 1 in views_block_view() in Drupal 7
After doing a bunch of operations during prototyping a Drupal 7 site we kept this error. There wasn’t anything that we seemed to be able to do to eliminate it from the Drupal administrative interface. After searching the web for quite some time I came across this page: http://objitsu.com/node/29 which gave me all of the information I need. From the article:
It’s caused by stale records in the block table that then fail to resolve. There’s plenty of reading material out there and suggested fixes etc. that I am sure work but once I knew what the problem was I applied *my process* for all Drupal problems like this.
- Find the code that issues the message..
- Trap the code and drupal_set_message() the offending item
- Use that information to fix-up the database / code as required.
Here’s how the fix works for this particular problem. In my case I edited views.module, line 569, here’s the code that was causing the notice to be show:
list($name, $display_id) = explode('-', $delta);
and here is what I added to the code to find out what the duff delta in question was…
if (count(explode('-',$delta)) == 1) { drupal_set_message($delta); } list($name, $display_id) = explode('-', $delta);
All I did then was refresh the page, take a note of hash value that was displayed and then cutting-and-pasting it into a command line MySQL session I issued this query:
mysql> DELETE FROM block WHERE delta = 'd98a0bfa5a33e7d8bab0fc0670bdc9fd'; Query OK, 4 ROWS affected (0.01 sec)
Which took out all four problem pages at once.
What are the command line commands for git?
We use git for source control of our iOS projects. I found a great cheat sheet of git commands here:
Git Cheat Sheet.The Cost of Free
Thursday, June 16th, 2011 by Butch WhitmireI emailed a respected marketer and he made a statement that was quite profound. He said, “Free stuff we’ll take all day long. But I also don’t want to work with somebody who gives away their products or services too cheap – if they can’t sell their own stuff, how can they help me sell mine?”
I loved his perspective in a time when open source code, free downloads, Groupons, free newsletters, “kids eat free,” are running rampant. People seem to crave “free” and statistically, they move in big numbers when the see the word “free” attached to a marketing campaign. However, I have big concerns with “free” (or the ridiculously reduced.)
As I wrote in an earlier post about scarcity, for things to be valuable people must perceive them as both a) useful and b) scarce. So, when we say something is “free” (meaning zero monetary value) people intuit that the service or good is either not very useful to them or it is abundantly available to all. Free lowers perceived value.
Another reason I am concerned about free is that people intrinsically intuit that “nothing is free.” So, clients assume there are strings or other cost attached. For example, our developers utilize an amazing open-source CMS/CMF called Drupal. This PHP-based code is available to us and everyone for no cash outlay. However, learning Drupal has been anything but free to Force 5. Our team has invested scores and scores of unbillable R&D hours to learn this protocol. “Free” usually has a cost attached – somewhere.
So, why are so many sales people and marketers using “free” (or ridiculously under-priced) to gain business? For me, there are only four plausible explanations:
1) You are lowering the barrier to entry. Free trials can lead to sales but they must be made scarce; meaning they are limited. Free one time to get to know your product or service. After that, it’s time to charge – drug dealers have known this for years.
2) You are relying on the social norm of reciprocity. (You scratch my back, I’ll scratch yours.) This is a risky approach. As I mentioned, people usually assume “nothing is for free” so they will take and take from you with little compulsion to give you anything in return.
3) You don’t believe your product or service is really very valuable. If this is the case, it’s time for a gut check. It’s time to evaluate and change your product or service to meet the demands of a crazily competitive market.
4) You’re a little lazy or at least not very creative. Free is easy. Free is fast. Free is simple. Free creates a lot of activity. Free doesn’t require you to make a compelling case for your product. Maybe it’s time to work on your marketing or selling skills, at least a little.
So the question must be asked: Are you overusing “free” and at what cost?