Skip to main content

Posts

Showing posts from 2014

Fatal error: Call to undefined function db_fetch_object in Drupal 7

db_fetch_object no longer in Drupal 7 Now its completely new database API has been added Drupal 7 introduces a completely new database API, utilizing a number of dynamic query builders and formal prepared statements. The following Drupal 6 functions and hooks were removed: db_affected_rows ( ), db_distinct_field ( ), db_error ( ),  db_last_insert_id ( ), db_placeholders ( ), db_lock_table ( ),  db_prefix_tables ( ), db_result ( ),  db_fetch_* ( ), db_version ( ), db_rewrite_sql ( ),  hook_db_rewrite_sql ( ), pager_query ( ), tablesort_sql ( ), and others. For full information, read the Database API guide.

Drupal 7 Menu Link update through update.php

This is for hook_update_N function If we have a default menu, use below code in install file. /**  * Implements hook_update_N to create menu reports.  */ function mymodule_update_7120 ( ) {   $menus = array (     'menu_name' => 'my_parent_menu',     ' title ' => 'My parent menu title',     ' description ' => 'My parent menu description',   );   $links = array (     'link_title' => 'My menu link title',     'link_path' => 'custom_path_for_menu_link',     'menu_name' => 'my_parent_menu',     ' weight ' => 0,     ' expanded ' => 0,   );   // Save menu group into menu_custom table   // Look the table first if the data does exist   $exists = db_query ( "SELECT title FROM {menu_custom} WHERE menu_name= : menu_name", array ( ' : menu_name' => $menus [ 'menu_name']) ) -> fetchField ( );   // Save the rec

Set the default language in Notepad++

I am showing this for the PHP language. In Notepad++   Click on Settings -> Preferences   Click on the New Document tab   Change the Default Language to PHP See below inage   To add an extension to load PHP editor for different extensions.   Click on Settings -> Style Configurator   In Language scroll down to PHP and click it.   In below it will show default ext.     Add your extensions at user exit. (Don't need '.').       eg:  inc install module   Click on Save & Close See below image for reference.

CKFinder Installation in the CKEditor for Drupal 7 Module

Please follow the steps below;  Go to http://ckfinder.com/download and download CKfinder Unpack the contents of the installation package into the directory that contains the CKEditor module and place it in thesites/all/modules/ckeditor/ckfinder (or sites/all/libraries/ckfinder) folder. . When the files are unpacked, you should see the following file structure inside the drupal/sites/all/modules directory: Now open the CKFinder configuration file (ckfinder/config.php) and introduce the code changes described below. Firstly, remove the CheckAuthentication() function (do not worry, this function is defined in filemanager.config.php, see below): function CheckAuthentication()       <- remove it {                                    <- remove it    //WARNING : DO NOT simply...      <- remove it    ...                               <- remove it    return false;                     <- remove it } For CKFinder installed in the sites/all/modules/ckeditor/ckfinder

Install cURL in Windows.

What is cURL? curl is a  curl is a command line tool for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, Telnet and TFTP . curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload, proxies, cookies, user+password authentication (Basic, Digest, NTLM, Negotiate, kerberos...), file transfer resume, proxy tunneling and a busload of other  useful tricks . How to install cURL? Open  http://curl.haxx.se/dlwiz?type=bin  in a browser. Select your operating system in the dropdown box: either Windows /Win32 or Win 64. Click Select! For Win 32, choose whether you will use curl in a Windows Command Prompt (Generic) or in a Cygwin terminal (cygwin). For Win 64, choose whether you will use curl in a Windows Command Prompt (Generic) or MinGW (MinGW64). Click Select! If required, choose your Windows operating system. Finish. Cli

Files that Drupal Themes Use

A drupal theme is a collection of files that define the presentation layer. You can also create one or more "sub-themes" or variations on a drupal theme. Only the .info file is required, but most themes and sub-themes will use other files as well. The following diagram illustrates the files that are found in a typical drupal theme and sub-theme. Drupal 6: Drupal 7: .info   (required) All that is required for Drupal to see your theme is a ".info" file. Should the theme require them, meta data, style sheets ,  JavaScripts ,  block regions  and more can be defined here. Everything else is optional in drupal theme. The internal name of the theme is also derived from this file. For example, if it is named "drop.info", then Drupal will see the name of the theme as "drop".  Drupal 5 and below used the name of the enclosing folder of the theme. Info files for themes are new in Drupal 6. In version 5, .info files were used solely for dru

Drupal User, Permission, Role in Drupal

Every visitor to your  drupal  site, whether they have an account and log in or visit the site anonymously, is considered a  user   to Drupal. Each drupal user has a numeric user ID, and non-anonymous users also have a user name and an email address. Other information can also be associated with drupal users by modules; for instance, if you use the core  Profile Drupal module , you can define user profile fields to be associated with each drupal user. Anonymous drupal users have a user ID of zero (0). The drupal user with user ID one (1), which is the user account you create when you  install Drupal , is special: that user has permission to do absolutely everything on the site. Other users on your site can be assigned permissions via  roles . To do this, you first need to create a role, which you might call "Content editor" or "Member". Next, you will assign  permissions  to that role, to tell Drupal what that role can and can't do on the site. Finally, yo