Saturday, December 13, 2014

Error handling : Drupal Commerce Kickstart V 2.0 -- 1


When I gave certain permissions to a user ( seller ) to view administration toolbar, it threw the following error and no toolbar is visible to seller.

Notice: Undefined index: #prefix in toolbar_megamenu_view() (line 51 of /var/www/html/ sitename /profiles/commerce_kickstart/modules/commerce_kickstart/toolbar_megamenu/toolbar_megamenu.module).



Solution :

Go to permissions tab --> Enable Use administration pages and help --> Save Configuration.



If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

Sunday, November 23, 2014

When installing mysql in linux, why do we create a mysql group and user?



Every process under linux runs under specific user privileges. Services (like MySQL) usually need to open ports and access various system resources during startup, so they are required to be started as root user.

However, it is not safe to have all the processes run under root as it is not required for continuous operation of services, thus it is recommended to create a special user, which will be used to run MySQL service.

MySQL will only be able to access what special user can, and this is going to be limited to MySQL files on the system.

This is usual practice in linux.





If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

Friday, November 21, 2014

cache_rules Errors in Drupal Websites

While building an E-Commerce website, I've encountered the following error


PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mydatabasename.cache_rules' doesn't exist: TRUNCATE {cache_rules} ; Array ( ) in cache_clear_all() (line 167 of C:\Users\globalsoftbay\Sites\devdesktop\mywebsitename\includes\cache.inc). "


Let's see how to solve this.

The above error occurs genrally when the cache_rules table/view is corrupt.



The easier way is to truncate the table without dtopping so that we don't need to create it again. But when I went to my phpmyadmin and clicked on this view, I received the following error.

" #1146 - Table 'mydatabasename.cache_field' doesn't exist "


So, now the solution is to drop it and create using same structure.

Execute the following SQL code and get it done. :)

  1. drop TABLE cache_rules;
  2. CREATE TABLE IF NOT EXISTS `cache_rules` (
  `cid` varchar(255) NOT NULL DEFAULT '' COMMENT 'Primary Key: Unique cache ID.',
  `data` longblob COMMENT 'A collection of data to cache.',
  `expire` int(11) NOT NULL DEFAULT '0' COMMENT 'A Unix timestamp indicating when the cache entry should expire, or 0 for never.',
  `created` int(11) NOT NULL DEFAULT '0' COMMENT 'A Unix timestamp indicating when the cache entry was created.',
  `serialized` smallint(6) NOT NULL DEFAULT '0' COMMENT 'A flag to indicate whether content is serialized (1) or not (0).',
  PRIMARY KEY (`cid`),
  KEY `expire` (`expire`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Cache table for the rules engine to store configured items.';

Refresh the page with error. If the error is gone, fine :) But my case is complex. I received one more error. Below is the same.

PDOException: SQLSTATE[HY000]: General error: 1030 Got error -1 from storage engine: TRUNCATE {cache_rules} ; Array ( ) in cache_clear_all() (line 167 of C:\Users\globalsoftbay\Sites\devdesktop\mywebsitename\includes\cache.inc). "

For fixing this, I followed this procedure.


If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

cache_field Errors in Drupal Websites

While building an E-Commerce website, I've encountered the following error


" PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mydatabasename.cache_field' doesn't exist: DELETE FROM {cache_field} WHERE (cid LIKE :db_condition_placeholder_0 ESCAPE '\\') ; Array ( [:db_condition_placeholder_0] => field\_info\_types:% ) in cache_clear_all() (line 167 of C:\Users\globalsoftbay\Sites\devdesktop\mywebsitename\includes\cache.inc). "


Let's see how to solve this.

The above error occurs genrally when the cache_field table/view is corrupt.



The easier way is to truncate the table without dtopping so that we don't need to create it again. But when I went to my phpmyadmin and clicked on this view, I received the following error.

" #1146 - Table 'mydatabasename.cache_field' doesn't exist "


So, now the solution is to drop it and create using same structure.

Execute the following SQL code and get it done. :)

  1. drop TABLE `cache_field`;
  2. CREATE TABLE IF NOT EXISTS `cache_field` (
        `cid` varchar(255) NOT NULL DEFAULT '' COMMENT 'Primary Key: Unique cache ID.',
        `data` longblob COMMENT 'A collection of data to cache.',
        `expire` int(11) NOT NULL DEFAULT '0' COMMENT 'A Unix timestamp indicating when the cache entry should expire, or 0 for never.',
        `created` int(11) NOT NULL DEFAULT '0' COMMENT 'A Unix timestamp indicating when the cache entry was created.',
        `serialized` smallint(6) NOT NULL DEFAULT '0' COMMENT 'A flag to indicate whether content is serialized (1) or not (0).',
        PRIMARY KEY (`cid`),
        KEY `expire` (`expire`)
        )
        ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Generic cache table for caching things not separated out...';
Refresh the page with error. If the error is gone, fine :) But my case is complex. I received one more error. Below is the same

" PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mydatabasename.cache_rules' doesn't exist: TRUNCATE {cache_rules} ; Array ( ) in cache_clear_all() (line 167 of C:\Users\globalsoftbay\Sites\devdesktop\mywebsitename\includes\cache.inc). "

For fixing this, I followed this procedure.



If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

[How to] upgrade a drupal site


  1. Backup Website files and Database
  2. Download latest version of drupal
  3. Extract the latest drupal and copy all those files and folders into existing website folder except sites/ folder
  4. Replace the existing files when asked
  5. Go to website.com/update.php 
  6. Proceed with the instructions






If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

Saturday, November 15, 2014

Drupal Commerce Installation


  1. WAMP server may not work well with Drupal Commerce causing Webpage not available kind of problems. 
  2. Better go to Acquia Dev Desktop from here and install. 
  3. After installing Acquia Desktop, it asks to choose one of the CMS's available in there. Choose Drupal Commerce
  4. Select latest PHP when asked.
  5. Launch the URL given by AD (Acquia Dev Desktop)
  6. Drupal Commerce Welcome screen appears in web browser
  7. Check I agree to the Privacy Policy and User Agreement radio button and proceed with Let's get started
  8. It verifies requirements, Sets up Database and installs Commerce KickStart 2
  9. Requirements problems:
    1. PHP memory limit 90M: Consider increasing your PHP memory limit to 128M to help prevent errors in the installation process. This problem can be solved by this link or raise a support ticket for the same if on web hosting.
  10. Installation takes a bit of time.





If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

Monday, January 27, 2014

[How to] Get thumbnail preview for Raw format photos in Ubuntu


Step 1 : Install UFRaw by using below command

sudo apt-get install ufraw 

Step 2 : Create a thumbanailer file using below command

sudo gedit /usr/share/thumbnailers/ufraw.thumbnailer

Step 3 : By default, the file contains no data. But if there is anything inside, please delete it.

 Step 4 : Copy the following code into it and save.

[Thumbnailer Entry] Exec=/usr/bin/ufraw-batch --embedded-image --out-type=png --size=%s %u --overwrite --silent --output=%o MimeType=image/x-3fr;image/x-adobe-dng;image/x-arw;image/x-bay;image/x-canon-cr2;image/x-canon-crw;image/x-cap;image/x-cr2;image/x-crw;image/x-dcr;image/x-dcraw;image/x-dcs;image/x-dng;image/x-drf;image/x-eip;image/x-erf;image/x-fff;image/x-fuji-raf;image/x-iiq;image/x-k25;image/x-kdc;image/x-mef;image/x-minolta-mrw;image/x-mos;image/x-mrw;image/x-nef;image/x-nikon-nef;image/x-nrw;image/x-olympus-orf;image/x-orf;image/x-panasonic-raw;image/x-pef;image/x-pentax-pef;image/x-ptx;image/x-pxn;image/x-r3d;image/x-raf;image/x-raw;image/x-rw2;image/x-rwl;image/x-rwz;image/x-sigma-x3f;image/x-sony-arw;image/x-sony-sr2;image/x-sony-srf;image/x-sr2;image/x-srf;image/x-x3f;


Note : You will get thumbnail previews automatically. If you didn't see just refresh nautilus :)

If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged