Ubercart, Uc_order (missing) error

We came across a funny situation yesterday on one of our ubercart ecommerce websites. The following error would be displayed when you went to the checkout:

Fatal error: Call to undefined function _line_item_list()

On closer examination, it seemed that the Ubercart Order module (uc_order) was broken. It appeared everywhere in the modules page as:

Uc_order (missing)

No amount of messing on this page or in the 'system' table would bring it back!

Drupal - CCK email field from PHP

Q: How do I access a node's CKK email field from PHP, I tried $node->my_email_field[0]['value'] and it didn't work?!
Q: A lot of fields can be accessed via ['value'] but not the CCK emailfield, instead use:

  $node->my_email_field[0]['email']

I keep forgetting this and have to switch on devel module and use dvm() to check the field makeup which is a pain - so I am writing it down now!

Ubercart - Modify Product Price Display

Q: I want to add some text like 'Incl. VAT' to the end of my ubercart product price when it's displayed, how do I do this?
A: In ubercart this is harder than you might expect, you have to add an ubercart 'price handler' that will change how the price is displayed, this is done in a custom module.

Drupal - Link blank problem

Q: I am using a link in drupal 6, I have set the link options to open a new page (html target="_blank"), when I click on the link a new page does open fine, but the original page is also redirected to the link target rather than staying on the page, how can I fix this?

Q: It seems that this problem can be caused by a clash with the Google Analytics module.

Drupal Secure Pages - Homepage Bug

Q: I am using the drupal Secure Pages module to SSL/SHTTP some of my website's pages. It seems to work well, but for some reason my website's home page is now always secured, visitors are always redirected to its https://blahblah.com version, even though I haven't specified that they should be. How can I fix this?

Drupal Facebook buttons not Displaying in IE8

Q: I am using the 'Facebook social plugins integration' module to display facebook buttons on my site, but the share button won't display in IE8, they show up fine on FireFox and other browsers, how do I fix this?

A: It seems that to get the buttons to display correctly in IE you need to add some facebook namespace references to your site's page template (page.tpl.php):

Drupal 'facebook social' like views field

Q: How can I include a facebook like button from the 'Facebook social plugins integration' module in a view as a field, the module doesn't seem to have views integration?

A: Install the ' Views Custom Field' module, create a new PHP field in your view and then include the PHP code that follows...

Install Drupal - register_globals off

Q: I am trying to install drupal and am getting an error about a PHP setting called register_globals, drupal says it can't continue with the installation until this setting has been turned off... How can I turn it off?

A: There are different ways to turn this setting off depending on how your hosting is set up, you can try (a) Adding a php.ini file in your web root folder, (b) Changes to you .htaccess file, (c) getting in touch with you hosting company and screaming blue murder ;-)

Drupal - Ampersand in ImageField

in

Q: I have a CCK ImageField for uploading pictures to my content type. It all works fine until a user tries to upload an image with an ampersand (&) or another funny character in the filename - The thumbnail will display in the node edit screen but otherwise I can't see the image in the node display or in views etc. What can I do? I can't force my users to upload images without ampersands!!

Drupal - Views remove duplicate nodes

Q: I am using views and am being driven mad by duplicate results being shown in the view output - especially when I use taxonomy terms, I have tried setting the views 'Distinct' option to 'Yes' but it doesn't work! What can I do to get rid of these duplicates?

A: Here is an excellent post on a method for removing duplicated nodes in a view's output: http://capellic.com/blog/cure-duplicate-nodes-in-a-view, it involves overriding YOURMODULE_views_pre_render().

Pride on FacebookPride on TwitterPride on TwitterPride on Twitter

Join Our Newsletter

* indicates required

Irish Internet Association

phone-number.png