• strict warning: Non-static method view::load() should not be called statically in /home/john567/drupalganger.com/sites/all/modules/views/views.module on line 843.
  • strict warning: Declaration of views_plugin_display::options_validate() should be compatible with views_plugin::options_validate(&$form, &$form_state) in /home/john567/drupalganger.com/sites/all/modules/views/plugins/views_plugin_display.inc on line 1877.
  • strict warning: Declaration of views_attach_plugin_display_node_content::options_submit() should be compatible with views_plugin_display::options_submit(&$form, &$form_state) in /home/john567/drupalganger.com/sites/all/modules/views_attach/views_attach_plugin_display_node_content.inc on line 239.
  • strict warning: Declaration of views_plugin_display_page::options_submit() should be compatible with views_plugin_display::options_submit(&$form, &$form_state) in /home/john567/drupalganger.com/sites/all/modules/views/plugins/views_plugin_display_page.inc on line 481.
  • strict warning: Declaration of views_handler_field_broken::ui_name() should be compatible with views_handler::ui_name($short = false) in /home/john567/drupalganger.com/sites/all/modules/views/handlers/views_handler_field.inc on line 641.
  • strict warning: Declaration of content_handler_field::options() should be compatible with views_object::options() in /home/john567/drupalganger.com/sites/all/modules/cck/includes/views/handlers/content_handler_field.inc on line 206.
  • strict warning: Declaration of views_handler_argument::init() should be compatible with views_handler::init(&$view, $options) in /home/john567/drupalganger.com/sites/all/modules/views/handlers/views_handler_argument.inc on line 745.
  • strict warning: Declaration of views_handler_argument_broken::ui_name() should be compatible with views_handler::ui_name($short = false) in /home/john567/drupalganger.com/sites/all/modules/views/handlers/views_handler_argument.inc on line 770.
  • strict warning: Declaration of views_handler_sort_broken::ui_name() should be compatible with views_handler::ui_name($short = false) in /home/john567/drupalganger.com/sites/all/modules/views/handlers/views_handler_sort.inc on line 82.
  • strict warning: Declaration of views_handler_filter::options_validate() should be compatible with views_handler::options_validate($form, &$form_state) in /home/john567/drupalganger.com/sites/all/modules/views/handlers/views_handler_filter.inc on line 585.
  • strict warning: Declaration of views_handler_filter::options_submit() should be compatible with views_handler::options_submit($form, &$form_state) in /home/john567/drupalganger.com/sites/all/modules/views/handlers/views_handler_filter.inc on line 585.
  • strict warning: Declaration of views_handler_filter_broken::ui_name() should be compatible with views_handler::ui_name($short = false) in /home/john567/drupalganger.com/sites/all/modules/views/handlers/views_handler_filter.inc on line 609.
  • strict warning: Declaration of views_handler_filter_node_status::operator_form() should be compatible with views_handler_filter::operator_form(&$form, &$form_state) in /home/john567/drupalganger.com/sites/all/modules/views/modules/node/views_handler_filter_node_status.inc on line 14.
  • strict warning: Declaration of views_plugin_style_default::options() should be compatible with views_object::options() in /home/john567/drupalganger.com/sites/all/modules/views/plugins/views_plugin_style_default.inc on line 25.
  • strict warning: Declaration of views_plugin_row::options_validate() should be compatible with views_plugin::options_validate(&$form, &$form_state) in /home/john567/drupalganger.com/sites/all/modules/views/plugins/views_plugin_row.inc on line 135.
  • strict warning: Declaration of views_plugin_row::options_submit() should be compatible with views_plugin::options_submit(&$form, &$form_state) in /home/john567/drupalganger.com/sites/all/modules/views/plugins/views_plugin_row.inc on line 135.
  • strict warning: Non-static method view::load() should not be called statically in /home/john567/drupalganger.com/sites/all/modules/views/views.module on line 843.
  • strict warning: Declaration of views_plugin_display_block::options_submit() should be compatible with views_plugin_display::options_submit(&$form, &$form_state) in /home/john567/drupalganger.com/sites/all/modules/views/plugins/views_plugin_display_block.inc on line 193.
  • strict warning: Declaration of views_handler_filter_boolean_operator::value_validate() should be compatible with views_handler_filter::value_validate($form, &$form_state) in /home/john567/drupalganger.com/sites/all/modules/views/handlers/views_handler_filter_boolean_operator.inc on line 128.

JBoss shutdown a running standalone instance

To Shutdown a running standalone instance running on OS X:

  1. open Terminal
  2. navigate to [JBOSS_HOME]/bin
  3. ./jboss-cli.sh --connect command=:shutdown

JBoss should stop. You see output like{"outcome" => "success"}

Useful Git Commands

Use Case: I create a local branch that I want to push into GitHub

git push -u origin local_branch_name

this will push that branch up to GitHub


 

Use Case: I want to pull and track a remote branch that I currently don't have in local

git checkout --track origin/remote_branch

this pulls the remote_branch to local, configures tracking it on the remote. Locally you will now be on that branch


 

Use Case: I want to delete a remote branch and its local branch

git push origin :branch_name

git branch -d branch_name

This pushes an empty to the remote and thus deletes remote branch. The second command deletes the local branc


 

Use Case: running git branch -a on my local repo shows remote branches which have been already deleted in the remote.

git remote prune origin

 

This fixes the information that local has about the remote. Now git branch -a will return the correct information about remote branches.


 

Use Case: I want to clone a git repo to specific changeset/revision: http://stackoverflow.com/questions/3489173/how-to-clone-git-repository-with-specific-revision-changeset

 

 


Use Case: I went to a version of one file from one branch into the branch I'm working in.

Run this from the branch that you want to receive the file

 

git checkout otherbanch theFile.txt

 

What will the next pope be named?

Error org.springframework.web.util.Log4jConfigListener

Cannot start java web application in STS (tcServer, Tomcat). This error occurs when starting a tcServer.

 

SEVERE: Error configuring application listener of class org.springframework.web.util.Log4jConfigListener
java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener

 

I have been able to fix this problem by running "maven clean" and "maven install" from STS and then restarting the server.

Subversion and Maven Tips and Tricks to save time updating

Lately I've been programming with a mid-sized group of developers. We are working on Windows for our development environment. Using subversion for source code control and maven for our build process. Because we have enough developers that there are code check-ins almost 24x7 it is important that other developers update their local code every day.

 

For a few days I had been manually updating the code from our repository by using TortoiseSVN and then running a command line "mvn clean install". Although this only took a few minutes to do each day I decided to write a batch file to automate this process.

What I wanted was something that would run:

 

svn update --username

mvn clean install -Dmaven.test.skip=true

 

This was simple enough to do in a single batch file. However once the process completed the cmd window would close so that I couldn't read any messages that were output. To get around this I created three batch files.  The first file that runs is named DailyUpdate.bat and includes one line:

cmd /K svnUpdate.bat

the file svnUpdate.bat has two lines

svn update --username

cmd /K mvnCleanInstall.bat

the final file mvnCleanInstall.bat has one line:

mvn clean install -Dmaven.test.skip=true

 

Now the cmd window stays open after this completes. I simplified the process for updating to the latest code and doing a local build.

Normally I have a shortcut to  DailyUpdate.bat in my windows startup directory so that it runs every time I start up my machine. There are some weeks where I don't want this running on startup, in that case I remove the shortcut.

 

Golf September 2010

September 2010. We ended with a 7 under. Winning score was 14 under. We had a shotgun start on hole 7. The weather was perfect. Mike won a Ping wedge, we also won an auction for a foursome round.

Sending email from localhost

I have recently used Simplenews  module to publish and send newsletters to lists of subscribers.  Simplenews has a feature to send an email to a test user, I wanted to use this to see exactly how the newletters would look.  I do much of my development from a local machine and I found that my test emails from my local machine were being incorrectly categorized as spam.  Basically I couldn't receive any email which I sent.

 

 I looked at my mail.log file to see the exact details of what was happening. Below is a section of what I found:

 

....to=<test@example.com>, relay=mx1.balanced.blingy.mail.example.com[208.108.38.62]:25, delay=1.5, delays=0.33/0.05/0.94/0.17, dsn=5.0.0, status=bounced (host mx1.balanced.blingy.mail.example.com[208.108.38.62] said: 554 Service unavailable; Client host [67.172.156.140] blocked using zen.dnsbl; http://www.spamhaus.org/query/bl?ip=67.172.156.140 (in reply to RCPT TO command))...

 

I spent a few hours seaching on the internet for a way that I could send email from my localhost without having it bounce back as spam. A friend pointed my to this information from page 9 of the MAMP manual:

 

Smart Host: Many spam filters will identify emails sent through dynamic IPs as spam. To avoid this, you can select a SMTP server with static IP that will cover the
actual sending process of the email for you.
 

 

This was very helpful because it helped move me toward a fix.  After a lot of searching  and trial and error I finally came to a solution. I didn't hit too many deadends along the way either, which was nice.

 The solution was to change the configuration of my local postfix installation.  These are configured in the file /private/etc/postfix/main.cf and they affect how email is handled from my local machine.  I added the following four lines to the end of my main.cf file

 mydomain = dev.example.com
myhostname =dev.example.com
myorigin = $mydomain
relayhost = [smtp.comcast.net]

After making this change I have had no problems sending Simplenew test emails from my local machine and they are no longer categories as spam.  I have been receiving the test emails in less than one minute. Once I'm satisified that the test email renders as expected I migrate my newletter to a hosted webserver.

 * the actual URLs that I worked with have been replaced with example.com above

 

Nice Menus Duplicate issue

Nice menus appear to output duplicate menus i.e. the same menu is output twice. This happens in certain configurations and can be difficult to fix if you do not know where to look.

For example, in the image below, the menu item "Menu to Front" is output twice. This site is configured with 1 menu item enabled in the Primary Links menu. There is also a nice_menus block enabled which has its Source Menu Tree set to Primary Links.

nice menu duplicate

Nice_menus is working exactly as it should. The reason this happens is that the Theme is outputting the Primary Links menu and Nice_menus is also outputting the Primary Links menu. 

I know of two configurations that can fix this which will allow the menu to appear only once. 

Method 1: Configure your Theme not to output the menu. In effect Nice_menus will be outputting your menu and the menu will appear only once.

  1. Navigate to Administer | Site Building | Themes
  2. Find your Theme and click configure
  3. Under Toggle display uncheck the box for Primary Links (or whichever menu you want the theme not to output)

Method 2: You can create a new menu, a menu that your Theme does not natively output. You will then configure Nice_menus to output this menu.

  1. Navigate to Administer | Site Building  | Themes
  2. Click Add Menu
  3. Give your menu a Menu name and Title , click Save
  4. Click Add Item and then add your menu items.
  5. Navigate to Administer | Site Building | Blocks
  6. Find your nice_menus block, click configure
  7. Under the Source Menu Tree select the new menu that you created in #3 above.

I prefer method 2 above because not every theme will have the configuration option. It also seems more intuitive to keep the expected Primary Link settings as provided by the theme.

Create Photo Gallery

Creating a Photo Gallery in Drupal is very easy. There is a very good tutorial which explains exactly what to do. I highly recommend this tutorial. The following pages distill the tutorial.

Monthly archive block

If you look at any website today you may notice that many have links to archived content. I find this feature extremely useful because it is a very intuitive way to view content. Implementing a Monthly archive block in Drupal is very easy. In fact it took me only about 15 minutes to implement and to post about my experience. I followed the tutorial Drupal archive list. The steps are very easy to follow. You will need to do some minimal Views configuration and you need to configure the block to appear on your site. But that is all. I am very happy with my results and I think everyone doing this will be happy with their results too.

Syndicate content