My journey as a developer...from websites to other coding and development issues
Monday, September 19, 2011
Debugging PHP in NetBeans (in Windows)
Here are the steps I used to setup PHP debugging in NetBeans (7.0 at the time of this writing).
The way to do it: http://xdebug.org/docs/install
You will need to download the correct php_xdebug from the xdebug.org site: http://xdebug.org/download.php
I downloaded the correct DLL for my environment and followed the install instructions. Below are my final php.ini settings:
This extension is disabled
;extension=php_xdebug.dll
[XDebug]
;; Only Zend OR (!) XDebug
;zend_extension_ts="D:\xampp\php\ext\php_xdebug.dll"
zend_extension_ts = "D:\xampp\php\ext\php_xdebug-2.1.1-5.2-vc6.dll"
xdebug.remote_enable=true
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.profiler_enable=1
xdebug.profiler_output_dir="D:\xampp\tmp"
NetBeans PHP Debug Settings
Friday, September 2, 2011
Thursday, September 1, 2011
Drupal 6 - Remove N/A from list of Radio button options
When creating a radio button field with CCK, you can remove the "N/A" option by making the field required.
fyi...to make your options turn into checkboxes, change "Number of values" to something other than 1.
fyi...to make your options turn into checkboxes, change "Number of values" to something other than 1.
D6 - SIMPLE module to get JavaScript working on a form
The very quick and easy way to get some JavaScript working on your form:
your_module.info:
name = Demo Information
description = Custom handling of demo information
core = 6.x
package = Your Company
your_module.module:
<?php
/**
* Implementation of hook_form_alter().
*/
function your_module_form_alter(&$form, $form_state, $form_id) {
// Only include on WHATEVER node add/edit forms. Adjust these lines based on your content types.
if ($form_id == 'new_item_node_form') {
drupal_add_js(drupal_get_path('module', 'your_module') .'/your_module.js');
}
}
your_module.js:
alert("Gotcha!");
- Add the 3 files below to your basic module structure. This module is called "your_module" for example purposes.
- Enable the module
- Clear cache
your_module.info:
name = Demo Information
description = Custom handling of demo information
core = 6.x
package = Your Company
your_module.module:
<?php
/**
* Implementation of hook_form_alter().
*/
function your_module_form_alter(&$form, $form_state, $form_id) {
// Only include on WHATEVER node add/edit forms. Adjust these lines based on your content types.
if ($form_id == 'new_item_node_form') {
drupal_add_js(drupal_get_path('module', 'your_module') .'/your_module.js');
}
}
your_module.js:
alert("Gotcha!");
Look at the HTML source and you should see your_module.js listed within all the other JavaScript files.
Wednesday, August 17, 2011
Using Git with a central repository
This is a nice write up on using Git with a central repository. A good tutorial for newbies to Git.
Friday, August 12, 2011
Migrating User Guides
So you've got that awesome functionality built for your Drupal site...but the user doesn't know how to use it.
Welcome to Books and "User Guide Migration". For Drupal 6
How this came to be for me:
I needed to create some user guides, so I thought Book. I needed this to run on a TEST server, because the users were learning here, and the LIVE server was not setup yet. I needed to be able to migrate this content to the LIVE server without having to copy and paste. I could not find a usable book export and import tool. None of the ones I tried worked very well. I tried the method below and was up and running in less than an hour (maybe it was less than 30 minutes...I don't remember).
First we need the modules:
Now, you need to PUSH to your destination (LIVE) server.
Welcome to Books and "User Guide Migration". For Drupal 6
How this came to be for me:
I needed to create some user guides, so I thought Book. I needed this to run on a TEST server, because the users were learning here, and the LIVE server was not setup yet. I needed to be able to migrate this content to the LIVE server without having to copy and paste. I could not find a usable book export and import tool. None of the ones I tried worked very well. I tried the method below and was up and running in less than an hour (maybe it was less than 30 minutes...I don't remember).
First we need the modules:
At this point it is important to setup the Deploy and Services modules correctly. I say correctly because the first time I did this, it didn't work. The initial reason was that I used Drush to download the modules and I ended up getting a wrong version. I believe I had to manually download and install the correct Services module to match Deploy. Reading the documentation in the link above will get you the correct versions. This was the only issue I came up with, but that was my fault. :)
Reading the rest of the documentation will get your deployment and live server setup. You need your deployment plan on your source server as well as authentication. You also need authentication setup on your destination server.
Now create your book. I won't go into the details about making a book, just add pages and modify the outline when necessary.
- Add your pages
- Change the outline where necessary
Now we are ready for pushing the content to your destination (LIVE) server. You have your book setup on your source (or DEV or TEST) server or wherever, and now you need to go LIVE with it.
- Open the book, and you should see the option of Deploy. Select this.

- Select the Deployment Plan. In this example I am selecting the plan that was previously created.

- If successful, you should see a list of pages that are setup in your deployment plan.
- Repeat this process for EACH page in your book. It's very easy to step through the book and then open the Deploy page in a new tab and do Step 2 later.
Now, you need to PUSH to your destination (LIVE) server.
- Go to Site Building, Deployment, and you should see your list of deployments

- Select push
- Now select the Server you want to push to and the username/password fields should display. Enter your credentials and click Push Deployment Plan.

- Magical wand...bells and whistles....everything should push to your destination server.
- Verify everything looks ok on the destination.
If you make updates to your book content, then a Push will get that to your live server. This is awesome so that you can make changes, have it approved, and then push to your LIVE server. Of course this approval process can be handled by workflow, but it's nice pushing and entire book (User Guide) at one time.
Gotchas:
- If you have images or other media in your book, they will not get pushed. They need to be uploaded to the server.
- Input Format: make sure the source and destination servers are setup with the same input formats. This only needs to be done once of course.
- After you have pushed, if you change the outline of your book and have added pages and messed around with it, it's possible to miss something. You can still step through the book and add each page (even if it exists in your plan). I have not found an issue with this yet. NOTE TO SELF: It's best to remember to add the page to the deployment plan RIGHT AFTER you have created he page.
Monday, July 18, 2011
Better Formats - D6
For Drupal 6, here's another module that I will be adding to my standard Drush make file. Per the author "Most of the features in BF are in Drupal 7 core now." so that is sweet.
Tuesday, June 28, 2011
Git - weird log message
I was receiving messages in my git log with something like "Merge branch 'branchname' of /blah/blah into 'branchname'
Found this very helpful site and blurb on how to fix this.:
http://wiki.sourcemage.org/Git_Guide#Why_do_my_commit_emails_have_extra_.22Merge_branch_.27master.27.22_messages.3F
Basically, it talks about doing a rebase.
Found this very helpful site and blurb on how to fix this.:
http://wiki.sourcemage.org/Git_Guide#Why_do_my_commit_emails_have_extra_.22Merge_branch_.27master.27.22_messages.3F
Basically, it talks about doing a rebase.
Friday, May 6, 2011
CKEditor in Drupal - Tip
Help your users and change one little configuration in the CKEditor Profile. Taking the following steps will give them a more consistent interface between their editors (OpenOffice, Word, etc.)
- Open the Profile in CKEditor that you are using
- Goto "Cleanup and ouput"
- Change "Enter mode" to <br>
- Change "Shift + Enter mode" to <p>
Wednesday, March 23, 2011
Drupal and Drush - Problems on Fedora 14
Oh man!!!! what a pain in the @ss this was!
My problem: Using Drush to download Drupal and other modules, I continually received issues where it seemed like Drupal or the module wasn't there. I would go to the site, and either the Drupal install wasn't recognized or the module wasn't recogized AT ALL. I could install, update and even enable/disable modules with Drush, but they would never show up in the website.
SOLUTION: not sure if this is with Fedora only or what (I'm on Fedora 14) but here is the command
chcon -Rt httpd_sys_content_t folder
folder, for example, might be the module you just downloaded.
It seems like Apache doesn't recognize or read the files unless the label is correct. use "ls -Z" to see the labels. This is something to do with SELinux.
Thanks to Madeye on this find (http://drupal.org/node/1044454).
My problem: Using Drush to download Drupal and other modules, I continually received issues where it seemed like Drupal or the module wasn't there. I would go to the site, and either the Drupal install wasn't recognized or the module wasn't recogized AT ALL. I could install, update and even enable/disable modules with Drush, but they would never show up in the website.
SOLUTION: not sure if this is with Fedora only or what (I'm on Fedora 14) but here is the command
chcon -Rt httpd_sys_content_t folder
folder, for example, might be the module you just downloaded.
It seems like Apache doesn't recognize or read the files unless the label is correct. use "ls -Z" to see the labels. This is something to do with SELinux.
Thanks to Madeye on this find (http://drupal.org/node/1044454).
Thursday, January 20, 2011
Drupal in NetBeans
Where to get it: http://drupalmodules.com/module/netbeans-templates
No this isn't a Drupal module, but where would something like this live otherwise? :) It's a collection of templates used within NetBeans and makes coding must faster. There are quite a few templates and it can take some time to figure them out, but the author did a good job using some naming conventions. For example, "h_menu" will insert a full template for hook_menu resulting in:
function mymodule_menu(){
$items = array();
$items['path'] = array(
'title' => 'title',
'description' => 'description',
'page callback' => 'callback',
'page arguments' => array('callback_arg'),
'access arguments' => array('access_arg'),
'file' => 'includes/mymodule_type.inc',
);
return $items;
}
After the template is inserted, mymodule is automatically selected and ready to be edited to the actual name of your module.
Installation instructions (as of NB 6.9):
A must have for NetBeans users.
No this isn't a Drupal module, but where would something like this live otherwise? :) It's a collection of templates used within NetBeans and makes coding must faster. There are quite a few templates and it can take some time to figure them out, but the author did a good job using some naming conventions. For example, "h_menu" will insert a full template for hook_menu resulting in:
function mymodule_menu(){
$items = array();
$items['path'] = array(
'title' => 'title',
'description' => 'description',
'page callback' => 'callback',
'page arguments' => array('callback_arg'),
'access arguments' => array('access_arg'),
'file' => 'includes/mymodule_type.inc',
);
return $items;
}
After the template is inserted, mymodule is automatically selected and ready to be edited to the actual name of your module.
Installation instructions (as of NB 6.9):
- Rename nb_templates.zip.txt to nb_templates.zip
- In NetBeans, goto Tools > Options > Editor > Code Templates and press the import button at the bottom.
- Browse and find nb_templates.zip, and select it.
- Select Editor > Code Templates
- Press OK
A must have for NetBeans users.
Friday, January 7, 2011
Module: AdminRole
Module Page: http://drupal.org/project/adminrole
Drupal Version Support:
This is one of the modules I include with every make file!!!. And now it is included in D7, so sweet!
Drupal Version Support:
- 6.x -> YES
- 7.x -> Included
From the module page:
This module is a little helper to maintain an administrator role which has all available permissions. By default, Drupal only has one super user and this module helps improve this drastically.
One of the first things many Drupal developers do when they create a new site is to create a role called "administrator" or something along those lines so that users other than User1 can do administrative tasks. However, as soon as a new module or content type is added, you must go into permissions and enable the permissions for your custom admin role. With the AdminRole module, you can select which role should be give these permissions by default.
HowTo:
- First make sure you create your administrator role. "Admin" is just fine for a name and takes up a lot less space than "Administrator" on the permissions page.
- Once you've downloaded and enabled the module, goto User Management->User Settings and scroll to the bottom. You should see something similar to this:
- Now just select the role you want to automatically assign new permissions to, and Save.
Friday, December 10, 2010
One Drupal to rule them all | Acquia
One Drupal to rule them all | Acquia: "The New York Stock Exchange is launching 30 sites on Drupal. Turner Broadcasting is migrating 80 sites to Drupal. A large consumer pharmaceuticals company might end up with over 3000 Drupal sites. Why? Because Drupal gives their IT team an agile platform to deliver new sites quickly with the breadth of capabilities to meet their needs, but broad enough in scope to serve as a web platform too."
- This was in a recent blog post by Dries on Acquia.com.
My Notes -
I've been following several Drupal job forums and feeds, and I must say the amount of activity over the past few months seems just awesome! What Dries says in his post is proof that Drupal is growing and CIO's are getting "smarter". Wish I knew some...just kidding...but not really. :)
As an example of it's growth, I'm aware that one local college has decided to "Go Drupal" with their current websites and backlog of work. They have many requests for internal websites, and there are some that will be ported to Drupal. "Go Drupal" - defined as that point in time when an organization decides that moving forward they will commit to Drupal and all new work will use Drupal. That's my definition...just made it. :)
The Eastern Iowa Drupal group recently started meeting in August and the excitement that has been seen in the group is so great to have and gets me more pumped to be working on such a great platform.
I have yet to find anyone in Cedar Rapids using Drupal, except for me of course. In Iowa City, there are 2 businesses and the University of Iowa that are using Drupal. It is growing, and it is worth it to take a look!!!
- This was in a recent blog post by Dries on Acquia.com.
My Notes -
I've been following several Drupal job forums and feeds, and I must say the amount of activity over the past few months seems just awesome! What Dries says in his post is proof that Drupal is growing and CIO's are getting "smarter". Wish I knew some...just kidding...but not really. :)
As an example of it's growth, I'm aware that one local college has decided to "Go Drupal" with their current websites and backlog of work. They have many requests for internal websites, and there are some that will be ported to Drupal. "Go Drupal" - defined as that point in time when an organization decides that moving forward they will commit to Drupal and all new work will use Drupal. That's my definition...just made it. :)
The Eastern Iowa Drupal group recently started meeting in August and the excitement that has been seen in the group is so great to have and gets me more pumped to be working on such a great platform.
I have yet to find anyone in Cedar Rapids using Drupal, except for me of course. In Iowa City, there are 2 businesses and the University of Iowa that are using Drupal. It is growing, and it is worth it to take a look!!!
Monday, November 8, 2010
Mix and Match Theme
I downloaded the Mix and Match theme real quick to try out and wow!!!! I really like it.
It uses Fusion as a base theme and to get all the bells and whistles, make sure you install Skinr.
1) There are some default color schemes you can pick from
2) Enable rounded corners for blocks, including the radius (3px, 7px, or 11px)
3) Overall, very easy to configure. Lots of options. Nice look.
It uses Fusion as a base theme and to get all the bells and whistles, make sure you install Skinr.
1) There are some default color schemes you can pick from
2) Enable rounded corners for blocks, including the radius (3px, 7px, or 11px)
3) Overall, very easy to configure. Lots of options. Nice look.
Thursday, August 5, 2010
Customizing the user profile layout | drupal.org
Customizing the user profile layout | drupal.org: "Customizing the user profile layout"
Great article on customizing the user profile. Also lots of snippets on the bottom of the page.
Friday, July 9, 2010
Ubuntu
I need the experience...I need to learn. I've been a long time user of Windows, just because that's the easiest. It's what has always been there at both home and work.
But now I'm trying Ubuntu at home. And I must say it is becoming addictive and fun. Yes there is a learning curve for us newbies, but I think I like it. There ae some things that are very easy to do, others take some trial and error. Everything is much faster (so far) from what I've seen. I'm trying to get better at the command shell, but my typing is not the best.
Faster?
- Open a file to edit. yes
- Run a command that's not recognized? A "try this" will be given, including how to get the files needed to run the command. I tried using drush and it wasn't recognized. Ubuntu told me how to get it. One command later and I'm running drush. No need to surf, download, and install. If the package is out there, you can start using it very quickly.
But now I'm trying Ubuntu at home. And I must say it is becoming addictive and fun. Yes there is a learning curve for us newbies, but I think I like it. There ae some things that are very easy to do, others take some trial and error. Everything is much faster (so far) from what I've seen. I'm trying to get better at the command shell, but my typing is not the best.
Faster?
- Open a file to edit. yes
- Run a command that's not recognized? A "try this" will be given, including how to get the files needed to run the command. I tried using drush and it wasn't recognized. Ubuntu told me how to get it. One command later and I'm running drush. No need to surf, download, and install. If the package is out there, you can start using it very quickly.
Tuesday, June 15, 2010
Drush Make on Windows
Here is a compilation of information (from posts I've found), that when combined got me drush make to work on my windows box. Windows 7 has some issues with permissions, but I'm looking into that.
Needed to run:
Needed to run:
- DRUPAL-6--2 branch of Drush Make - I'm using the version from 6/14/2010.
- GnuWin32 packages - I used GetGnuWin32 ( http://getgnuwin32.sourceforge.net/) for this large feat. :)
- Slash and Tar Patch - thanks to ribbles (http://drupal.org/node/625948#comment-2993878) plus Tar patch thanks to this post http://drupal.org/node/818192
- Once GnuWin32 is installed, rename the copy of tar.exe to something else (tar-old.exe). Tar.exe is old and doesn't do the required things for drush_make. There's more info on tar.exe on the GnuWin32 site (http://gnuwin32.sourceforge.net/packages/gtar.htm)
- Copy bsdtar.exe to tar.exe
- run the drush make command: drush -v -d make standard.make Test
Here is the standard.make (example):
; This file was auto-generated by drush_make
core = 6.x
projects[] = "drupal"
; Modules
projects[] = "admin_menu"
projects[] = "dhtml_menu"
projects[] = "porterstemmer"
projects[] = "token"
Monday, May 10, 2010
Drush ckeditor-download
This is a nice command for downloading the CKEditor libraries into the sites/all/libraries folder and I have used this many times in the past, but just realized that when running on a new machine that it didn't work.
Duh! I needed Subversion installed. Should have been one of the first steps since I use Subversion. But.........
What if some other drush command requires CVS or Git? I don't think a developer should have to install every version system just to make sure it works. Then again, installing Subversion is a piece of cake. :P
Here is the error was getting after using verbose:
Executing: svn checkout [notice]
http://svn.fckeditor.net/CKEditor/releases/stable/
Duh! I needed Subversion installed. Should have been one of the first steps since I use Subversion. But.........
What if some other drush command requires CVS or Git? I don't think a developer should have to install every version system just to make sure it works. Then again, installing Subversion is a piece of cake. :P
Friday, February 5, 2010
Zend PHP 5 Certification - ZCE - Zend.com
Zend PHP 5 Certification - ZCE - Zend.com: "Zend PHP Certification
Setting the Industry Standard for PHP Certifications
Sponsored by Zend and developed according to American National Standards Institute (ANSI) standards, Zend Certification programs are designed to test a candidate’s level of knowledge in PHP or Zend Framework without prejudice to other technologies. The tests use a set of testing questions that reflect real-world scenarios, including knowledge in many areas ranging from basics to the more complex topics. The certification exam is executed for Zend by Pearson Vue."
Setting the Industry Standard for PHP Certifications
Sponsored by Zend and developed according to American National Standards Institute (ANSI) standards, Zend Certification programs are designed to test a candidate’s level of knowledge in PHP or Zend Framework without prejudice to other technologies. The tests use a set of testing questions that reflect real-world scenarios, including knowledge in many areas ranging from basics to the more complex topics. The certification exam is executed for Zend by Pearson Vue."
I've been thinking about this for a short while. With a majority of my experience being Java, how do I convince someone that I can code in PHP. I'm not aware if there are Drupal certifications, but PHP might be a good start if that's where I want to head.
By convince, I mean that I can, but it's not really apparent. You have to either show some code samples or a certification.
Monday, February 1, 2010
| Drupal Gardens
Drupal Gardens Blog: "Drupal Gardens launches in private beta
Submitted by Dries on Wed, 01/27/2010 - 07:59
I have a pretty big update for you: we just launched Drupal Gardens into private beta. Since the first public Drupal Gardens demo at DrupalCon Paris, a lot of progress has been made. Today, we sent private beta invites to the first people that signed up to be beta testers, and if things go well, we'll send out a couple thousand more invitations over the next few weeks."
Submitted by Dries on Wed, 01/27/2010 - 07:59
I have a pretty big update for you: we just launched Drupal Gardens into private beta. Since the first public Drupal Gardens demo at DrupalCon Paris, a lot of progress has been made. Today, we sent private beta invites to the first people that signed up to be beta testers, and if things go well, we'll send out a couple thousand more invitations over the next few weeks."
This is a pretty awesome website in my opinion. Yeah, it might hurt the little guy, but it'll also help too. Help more than hurt. When you get the name of Drupal out there more, people won't be requesting as many "websites" and they will be requesting more "Drupal websites". I build Drupal websites, but I don't have the resources to build the "Automated website builder in 15 minutes" functionality.
So yes, this will help me. There's still the local website customer. There's still the Entrepreneur websites I want to build.
Great job for Acquia and Dries!!!
Subscribe to:
Posts (Atom)




