Jan 122014
 

First run of the brand spanking new Intellij 13 – and I get createComponent() returns null for: class com.intellij.execution.RunManager – it turns out to be an issue with plugins, so remove your .IdeaIC13\config\plugins directory and restart you’ll be good to go (sans plugins) – no more createComponent() returns null for: class com.intellij.execution.RunManager issues on Intellij 13!

Nov 182013
 

As much as a note to self as anything else, for some reason it proved hard to find out how I could use html in the auto validation messages generated by models in CakePHP.  Now it’s totally arguable that the use of html is not best practice in this case, the right or wrong of that on a technical level is entirely up to you however assuming you do need/want to use html in the validation messages just make sure that on forms that are applicable you either use a custom form error trap:

e.g.

$this->Form->input(‘yourfield’,array(‘error’=>false);

$this->Form->error(‘yourfield’,array(‘escape’=>false);

OR the simpler mechanism is:

$this->Form->input(‘yourfield’,array(‘error’=>array(‘escape’=false);

As an added benefit assuming you’re wanting to wrap your html validation message in a custom div simply add a class attribute:

$this->Form->input(‘yourfield’,array(‘error’=>array(‘escape’=false,’class’=>’alert alert-error’);

So this is how you put html in CakePhp validation messages!

 

 

Jan 212013
 

For some reason wp_redirect/wp_safe_redirect in WordPress can be a total pain, whether it be when writing custom front end code, plugins or widgets I seem to come across an issue with redirects periodically, with the utterly frustrating “Cannot modify header information – headers already sent” error.  As a heads up, this is caused as the name suggests by  content in a header being pushed down before the redirect is called, this is a generic issue not one that is specific to WordPress.  More often than not it is simple to identify, if any of the involved PHP files have leading or trailing white space, and or there’s some hidden debug output you have forgotten.  Occasionally the issue is WordPress however, in my case the issue of wp_redirect not working on a custom admin page, was caused by a function in

/wp-admin/includes/template.php:1636 or so, whereby headers/html, quite a lot of them are indeed sent as part of the page load process.

Having ensured all of my files were trimmed and there was nothing wrong with my plugin code, I discovered here that there’s a little workaround for forms being called in custom admin pages, that is simply to append:

&noheader=true

To your action, e.g.

<form method=”POST” action=”?page=your-plugin-page&noheader=true”>

This resolved my problem instantly – understandably given it suppressed the content being produced in template.php!

Hope it helps anyone having problems with wp_redirect and wp_safe_redirect on custom admin pages in WordPress.

 

 

Jan 092012
 

I’ve just spent tow frustrating hours going around the houses, trying to work out how to link my brand new Facebook I-frame app to my fan page.  I’ve done this successfully before, but it was a while ago so this is a note to self.  I’m constantly amazed at how despite such comprehensive documentation it can be so difficult to find things that are so fundamental to how a Facebook app works.  So, in case it helps, to link a  Facebook app to a fan page (other than the page you create for the app) you need to use this url:

https://www.facebook.com/dialog/pagetab?app_id=YOUR_APP_ID&next=YOUR_URL

Obviously replacing the capitalised details.  The app ID is easy – found here in your app settings, the url as far as I can tell can be anything, just cut and paste your app url here and it will redirect you to it afterwards.  When linking your Facebook app to the fan page, the link above will allow you to select which page you want to link to, submit this.

From here, go to your fan page > edit page > apps (in the left nav) and the new app should be listed, from which point you can choose to “link to this tab” and it will appear in your menu on the left.

The information for this was sourced from https://developers.facebook.com/docs/appsonfacebook/pagetabs/ hopefully it will help you with how to link a Facebook app to a fan page.

 

 

 

Nov 022011
 

WordPress is fantastic, what else can you say.  The new custom post types and taxonomies make it a super powerful system that can handle the vast majority of average web content management requirements simply and quickly.  It does have its quirks to be sure, and one of them is the tendency for it to screw up it’s permalink cache at times producing random 404 errors on pages that were working to that point.  This often happens when you change slug values in your functions.php but it can certainly happen at other times.  If this happens the quickest way to sort it (normally) is to reset your permalink structure to the default then reapply any custom paths you have defined.  Volia, old pages back on track, no more random 404s on WordPress.

Sep 292011
 

I’ve spent the last couple of nights working through Centos rebuilds, solr installations, and hook_blocks that just weren’t working the way I wanted them too, so this morning on booting up my newly restored system on encountering “Call to undefined function zen_menu_item_link()” I was just about ready to punch something!

After ranting a bit and the only references online to Call to undefined function zen_menu_item_link() being the error itself on unmaintained sites I took deep breaths and went through my “broken drupal” checklist.  Fortunately on this occasion the problem was fixed by flushing out all the cached variables.  In SQL paste the following:

 

update system s
set s.status=0, s.throttle=0, s.bootstrap=0
where filename = ‘modules/update/update.module’;

TRUNCATE cache;
TRUNCATE cache_block;
TRUNCATE cache_content;
TRUNCATE cache_filter;
TRUNCATE cache_form;
TRUNCATE cache_menu;
TRUNCATE cache_page;
TRUNCATE cache_update;

And the drupal issue Call to undefined function zen_menu_item_link() should be no longer!

 

Jun 282011
 

Having decided to get back onto the blog mission again and redefine my online thang somewhat I chose to combine and remove a few twitter accounts I had been using.  In case you’re wondering about the username change (unlikely, true, but in case you are!) I managed to skip through the clearly presented T&Cs of cancellation by twitter:

So now not only have I closed my old twitter account I’ve also, in the exuberance of changing twitter accounts blocked my original name, @spottmedia.  So two lessons learned, read the instructions and if it’s not broke don’t fix it!

 

 

 

Mar 282010
 

In all the years I have used excel I have never once encountered this problem so hopefully this helps anyone else in the situation.  I have been used to Excel automatically updating its values (say in a sum() column) whenever I change values above, but somehow today it stopped working.  fortunately my better half happens to be an Excel nerd, so with her help I worked out what it was.

If you find that the values in Excel are not updating automatically it is probably because you have not got the (succinctly named) “calculation options” switched to automatic.  Apparently back in the day you were required to press F9 to do calculations at any stage, and indeed this still works, but if you want a more permanent solution in Excel 2007 at least goto:

Formulas > Calculation > Calculation options

Then check the “Automatic” selection.  This should rectify the problem immediately.

Nov 242009
 

Working through an implementation of the Facebook Connect I got caught up in the tangle of documentation that surrounds it and couldn’t work out how to get the session key information so here it is a note to self about how to retrieve the Facebook session key using php client api:

$fbsessionid = $this->facebook->api_client->session_key;