drupal

Upgrades not updating properly!!! AAAAArrrrggggghhhh!!!!

Posted by gordon on Mon, 21/06/2010 - 2:23pm

Working on an import of some content for a client I have found that some things were not working such as auto node title.

After spending about 30 minutes banging my head to work out what the problem was. If was a problem that I had forgotten about, as I needed to get around this in the past.

Basically the problem is that when you do an update of your system hook_init() is not called. Normally this is not a problem but what happens in that modules like cck use hook_init() to include the token implementation, or even in the case of strongarm all the $conf is updated during hook_init().


Finally cleaned my site up.

Posted by gordon on Sun, 23/05/2010 - 6:42pm

I did some work today and cleaned up my website so it is not a spam sink and updated all the modules to the latest version of Drupal 5.x. Next is to upgrade it to Drupal 6 ready for Drupal 7. Also I got rid of CAPTCHA and I am now using Mollom which should stop the spam.

I have a number of articles I want to publish and now I have a place to publish these again, and will start publishing again.


Twitter

Posted by gordon on Tue, 06/05/2008 - 10:05am

As of late I have been getting into twitter a bit. I have started using twirl to post tweets from desktop which is really cool.

I like so much that I have start tweeting while I am developing letting people know what I am up to now.

You can follow me on http://twitter.com/gheydon

Update: Fix up url for twhirl


Captcha on Site

Posted by gordon on Wed, 29/08/2007 - 12:44am

Since I have upgraded my site to Drupal 5 I have added to Captcha to get rid of the bloody spam comments. Originally I was going to just use the math or other basic captcha's to implement a very clean captcha.

But I was listening to Security Now, Leo and Steve were talking about reCaptcha which not only a allows the use of captcha, but also helps with other projects. Here is a quick snippet of what these projects are

To archive human knowledge and to make information more accessible to the world, multiple projects are currently digitizing physical books that were written before the computer age. The book pages are being photographically scanned, and then, to make them searchable, transformed into text using "Optical Character Recognition" (OCR). The transformation into text is useful because scanning a book produces images, which are difficult to store on small devices, expensive to download, and cannot be searched. The problem is that OCR is not perfect.

So what they do is take these mis-converted words and use them as the captcha image and people responses are passed back to the projects to allow the projects to quickly fix up all the missing words that the OCR's couldn't get.

So if you do need to have captcha on your site, you might as well make it help other projects at the same time. So far for me it is working great. If you want to use recaptcha then you will find it at http://drupal.org/project/recaptcha

 


Well I have finally done it.

Posted by gordon on Sun, 05/08/2007 - 2:27pm

After many months of resistance I finally upgraded my site to Drupal 5.

OK, it was not resistance, I just didn't have time to do it. So now I have done it and I am managed to log into my site after Dreamhost upgraded to PHP 5.2 and I then couldn't log in with 4.7+

Oh well it is done now, so I can move forward and do some cool stuff.


Drupal test sites.

Posted by gordon on Sun, 05/11/2006 - 5:40pm

When developing a new site, for anyone you will generally have test and/or development version of a site. These sites are usually exact copies the live site, and from time to time you will copy the live database to these sites.

Usually when doing this you will go through the site and change some of the configuration values, like the gmap api number, and others like the path to payment gateways and credit card gateway indentification numbers to point to test versions of the payment gateways.

Generally doing this by hand you will miss some parameters, and have it really cause problems later. But there is an answer that will allow you to set these values automatically so that depending on the site, will be rewritten correctly everytime.

In the sites directory you will have a directory for each site, and a settings.php file in each of these directories. Just add to your test file the following

<?php
$conf = array(
  'site_mail' => 'test@example.com.au',
  'ccard_clientid' => 'example_no',
  'ccard_url' => 'https://test.example.com/store/payment/ccard',
  'googlemap_api_key' => 'ABQIAAAAhfBLLoKUHq7LqQ2QBcWQ2hRCSo_fHprJOtfmhc0LOWj7Ebi-6BSINRQq0Kie8sAsQKjO1tEi-ZFxSw',
);
?>

This will override these values above and will mean that you will never need to change them again. 

Also to speed up the download and update of your local database quickly and if you have a ssh connection to your webserver, try the following.

ssh webuser@example.com mysqldump -udbuser -pdbpasswd drupaldb | mysql -ulocaldbuser -pdbpasswd localdrupaldb

If you put this into a small shell script it is just a simple command away.


chx formapi tip.

Posted by gordon on Thu, 24/08/2006 - 11:30am

Yesterday I was having fun with the image module creating a new hook to allow people to build contrib module which will modify images when they are uploaded. see http://drupal.org/node/42835 for more details.

I needed to add in a hook to the node so that it would call my process after the validation had completed. and would always be called no matter what action was taken, Preview or submit.

I triied adding it before the #submit, but it would not call on a preview. After talking with chx, I found a cool feature, and a use for buttons besides firing scripts.

If you have 

<?php
$form['preview'] = array(
  '#type' => 'button',
  '#value' => t('Preview'),
);
?>

When the user clicks on this button, it will submit as normal, but in the forms api, hook_validate() will be called but hook_submit() will not.

Cool for doing previews, but not submit.

Also the Image module now has views integration. Yay.
 


Simple access and Organic Groups integration

Posted by gordon on Thu, 10/08/2006 - 12:29am

One of the biggest problems with the node_access system is that the you can only really use 1 node access module at a time. So if you want to use simple_access and organic groups together, the access is not really going to work very well. In fact it is totally useless.

Their is the great node_arbitrator module which will allow modules to do this, but you need to use a new hook, that both simple access and og do not support, but both intend to support in the future. (I know that when I get a bit of time I will put it into simple access)


Melbourne Meetup II

Posted by gordon on Thu, 13/07/2006 - 11:20pm

Well it is that time again, and Melbourne is having it's second Meetup.

We have taken up a kind offer from Luke Hodges @ Sustainable Living Foundation to use their premise and internet to make this a much better meetup that people will learn more and gain more from this event.

see http://groups.drupal.org/node/993 for more information and the siteup sheet so we have a good idea on how many people are going to be comming.

I hope to see a good turn out, and hopefully better than we did have last time.


Adding a Drupal page as a Tab to the CiviCRM Contacts page.

Posted by gordon on Thu, 22/06/2006 - 12:18pm

Over the last month or so I have doing a project which involved installing CiviCRM for my clients contact managements needs. So because of this I have been crawling around CiviCRM quite a bit.

One of my clients requirements to a membership system which is linked to both CiviCRM and Drupals E-Commerce, and gives access to the parts of the system, and some other items such as books, and resources.

I developed this membership system in Drupal, and used the CiviCRM API to update contacts. But when enquiring on contacts the problem was getting easy access to the membership information and history. The obvious answer was to add a tab to the contacts page for the membership information.

The problem with this is that the membership system was developed in Drupal, and not in CiviCRM, so adding the tab, and making the tab look like a CiviCRM page was going to be a challenge.