Difference Drupal6 Drupal7

download Difference Drupal6 Drupal7

of 21

Transcript of Difference Drupal6 Drupal7

  • 5/20/2018 Difference Drupal6 Drupal7

    1/21

    What's New in Drupal 7

    Drupal 7 is released.Download the full release version.

    Here is a summary of changes introduced to Drupal 7.You can also see the complete Drupalchange log.

    New Minimum System Requirements:

    This is not a complete list of requirements.Please read the complete list of requirements.

    Database: MySQL 5.0.15 or PostgreSQL 8.3 PHP Version 5.2 or higher PHP Memory: 40M - 64M

    Security:

    More secure implementation for scheduled tasks (cron.php). More secure password system. More secure log-in system.

    Modules can be updated via the web.

    Usability:

    Administrative links to edit existing page elements are now available on each web

    page, without having to go to an administration page first. Improved support for integration of WYSIWYG editors. Added more drag-and-drop for administrative tasks. Permissions now have the ability to handle more meta-data (permissions now have a

    description). User 1 created as part of the installation process. Added features to the default install profile (tagging on the Article content type).

    Setting up automated task runs (cron) can now be achieved via Drupal's configurationalone, without having to install any scripts on the web server.

    Redesigned password strength validator to make it kinder and gentler, and clearer. Renamed "input formats" to "text formats".

    Added support for default text formats to be assigned on a per-role basis. Moved text format permissions to the main permissions page Added "vertical tabs", a reusable interface component that features automatic

    summaries and increases usability. Improved time zone support

    Removed per-user themes: Contributed modules with similar functionality areavailable.

    Added new "Shortcuts" module to allow user to create their own menu for the pagesthey visit the most.

    Database:

    http://drupal.org/project/drupalhttp://drupal.org/project/drupalhttp://drupal.org/project/drupalhttp://drupalcode.org/project/drupal.git/blob_plain/497914920385b7016ac9c9367e0198530787adf2:/CHANGELOG.txthttp://drupalcode.org/project/drupal.git/blob_plain/497914920385b7016ac9c9367e0198530787adf2:/CHANGELOG.txthttp://drupalcode.org/project/drupal.git/blob_plain/497914920385b7016ac9c9367e0198530787adf2:/CHANGELOG.txthttp://drupalcode.org/project/drupal.git/blob_plain/497914920385b7016ac9c9367e0198530787adf2:/CHANGELOG.txthttp://drupal.org/requirementshttp://drupal.org/requirementshttp://drupal.org/requirementshttp://drupal.org/requirementshttp://drupalcode.org/project/drupal.git/blob_plain/497914920385b7016ac9c9367e0198530787adf2:/CHANGELOG.txthttp://drupalcode.org/project/drupal.git/blob_plain/497914920385b7016ac9c9367e0198530787adf2:/CHANGELOG.txthttp://drupal.org/project/drupal
  • 5/20/2018 Difference Drupal6 Drupal7

    2/21

    Added query builders for INSERT, UPDATE, DELETE, MERGE, and SELECTqueries.

    Support for master/slave replication, transactions, multi-insert queries,delayed inserts,and other features.

    Added support for the SQLite database engine.

    Default to InnoDB engine, rather than MyISAM, on MySQL when available forgreater scalability and data integrity.

    Several Performance Improvements Implemented

    Documentation:

    Hook API documentation now included in Drupal core.

    News aggregator:

    Added OPML import functionality for RSS feeds. Added feed update options.

    Search:

    Added support for language-aware searches.

    Testing:

    Added test framework and tests.

    Theme system:

    Removed the Bluemarine, Chameleon and Pushbutton themes. These themes live onas contributed themes

    Added "Bartik" theme as the default user interface theme. Added "Seven" theme as the default administration interface theme. Added "Stark" theme to make analyzing Drupal's default HTML and CSS easier.

    File handling:

    Files are now first class Drupal objects with file_load(), file_save(),and file_validate()functions and corresponding hooks.

    Files use PHP stream wrappers to enable support for both public and private files andto support pluggable storage mechanisms and access to remote resources (e.g. S3storage or Flickr photos).

    Added a field specifically for uploading files, previously provided bythe contributed module FileField.

    Image handling:

    Improved image handling, including better support for add-on imagelibraries.

  • 5/20/2018 Difference Drupal6 Drupal7

    3/21

    Added a field specifically for uploading images, previously provided by thecontributed module ImageField.

    Better Support for Multisite Installations

    Added RDF support

    Better support for search engine optimization and web linking

    Added ability to add custom fields

    Provides most of the features of the former Content Construction Kit (CCK) module. Custom data fields may be attached to nodes, users, comments and taxonomy terms.

    Node bodies and teasers are now fields instead of being a hard-coded property of nodeobjects.

    Fields are translatable.

    Installer can be run from the command line

    JavaScript changes

    Upgraded the core JavaScript library to jQuery version 1.4.2.

    Upgraded the jQuery Forms library to 2.36. Added jQuery UI 1.8, which allows improvements to Drupal's user experience.

    Improved node access control system

    Task handling

    Improved handling of long-running tasks.

    what is entity and entity api?Ans:They provide a unified way to work with different data units in Drupal. Drupal 7 is allabout entities. They are everywhere: nodes, users, taxonomy terms, vocabularies

    But how, as developers, can we create our own entities? When do we really need to do that? I

    think these questions are really very project-specific. We can probably use nodes for nearlyeverything. But when it comes to performance-sensitive projects, nodes should really only beused for content, and we should separate as much as possible from nodes. Why? Nodes arerevisioned, they fire a lot of hooks, and they have functionality that we likely wont need.Also if we know exactly what fields we should have in our entities, we can create our owncustom entities to avoid all those joins of Field API tables.

    what is use of user entity?Ans: Check this URL:https://drupal.org/node/1261744

    What is hooks?

    Ans:Allow modules to interact with the Drupal core.

    https://drupal.org/node/1261744https://drupal.org/node/1261744https://drupal.org/node/1261744https://drupal.org/node/1261744
  • 5/20/2018 Difference Drupal6 Drupal7

    4/21

    Drupals module system is based onthe concept of hooks. A hook is a PHP function that isnamed foo_bar(), where foo is the name of the module (whose filename is thus foo.module)and bar is the name of the hook. Each hook has a defined set of parameters and a specifiedresult type.

    How to do the for drupal debuggingAns:usedevelmodule and Use xdebug application

    Which files are required for theme?Ans: style.css, page.tpl.php, info file, template.php, node.tpl.php, block.tpl.php

    Which files are required for module?Ans: modulename.info, modulename.module, optional modulename.install

    which are common modules used in project? Ans:Webform,Devel,Drush,Views,Backup & Migrate,Date,Address field, file field, link,

    media, Rules, SMTP, View Slideshow, Print,Lightbox2, Varnish, memcache, Wysiwyg, ckeditor, Google Analytics, Metatag, XML SiteMap, Redirect, Page Title, Chaos Tools,Token, Entity, Panels, Features, Coder

    What is Drushhow drush is used?Ans: Drush is a command line shell and scripting interface for Drupal, a veritable SwissArmy knife designed to make life easier for those of us who spend some of our workinghours hacking away at the command prompt.

    what is PDO?

    Ans: PDO is an acronym for PHP Data Objects. PDO is a lean, consistent way to accessdatabases. This means developers can write portable code much easier. PDO is not anabstraction layer like PearDB. PDO is a more like a data access layer which uses a unifiedAPI (Application Programming Interface).

    How PDO used in drupal?Ans: Drupal provides a database abstraction layer to provide developers with the ability tosupport multiple database servers easily. The intent of this layer is to preserve the syntax and

    power of SQL as much as possible, but also allow developers a way to leverage morecomplex functionality in a unified way. It also provides a structured interface for dynamicallyconstructing queries when appropriate, and enforcing security checks and similar good

    practices.

    The system is built atop PHPs PDO (PHP Data Objects) database API and inherits much ofits syntax and semantics.More:https://api.drupal.org/api/drupal/includes!database!database.inc/group/database/7

    How to use preprocess function?Ans:The main role of the preprocessor is to set up variables to be placed within the template(.tpl.php) files. From Drupal 7 they apply to templates and functions, whereas in Drupal 6

    preprocess functions only apply to theming hooks implemented as templates. Plain themefunctions do not interact with preprocessors.

    More:https://drupal.org/node/223430

    https://drupal.org/project/develhttps://drupal.org/project/develhttps://drupal.org/project/develhttps://drupal.org/project/Webformhttps://drupal.org/project/Webformhttps://drupal.org/project/Webformhttps://drupal.org/project/Develhttps://drupal.org/project/Develhttps://drupal.org/project/Develhttps://drupal.org/project/Viewshttps://drupal.org/project/Viewshttps://drupal.org/project/Viewshttps://drupal.org/project/backup_migratehttps://drupal.org/project/backup_migratehttps://drupal.org/project/datehttps://drupal.org/project/datehttps://drupal.org/project/datehttps://api.drupal.org/api/drupal/includes%21database%21database.inc/group/database/7https://api.drupal.org/api/drupal/includes%21database%21database.inc/group/database/7https://api.drupal.org/api/drupal/includes%21database%21database.inc/group/database/7https://drupal.org/node/223430https://drupal.org/node/223430https://drupal.org/node/223430https://drupal.org/node/223430https://api.drupal.org/api/drupal/includes%21database%21database.inc/group/database/7https://drupal.org/project/datehttps://drupal.org/project/backup_migratehttps://drupal.org/project/Viewshttps://drupal.org/project/Develhttps://drupal.org/project/Webformhttps://drupal.org/project/devel
  • 5/20/2018 Difference Drupal6 Drupal7

    5/21

    Setting up variables for use in a template(preprocess and process functions)The main role of the preprocessor is to set up variables to be placed within thetemplate(.tpl.php) files. From Drupal 7 they apply to templates and functions,whereas in Drupal 6 preprocess functions only apply to theming hooksimplemented as templates; plain theme functions do not interact with

    preprocessors.Notes:

    Preprocessors are also used for providingtemplate suggestions. In versions 5 and below, the function _phptemplate_variables served the same

    purpose. It has been deprecated in 6. Prior to Drupal 6.7, for your theme to have its preprocessors recognized, the

    template associated with the hook had to exist inside the theme. When a defaulttemplate exists, copy it to your theme and clear the registry (or you shouldreally be upgrading to a later version of Drupal anyway for security reasons, atwhich point you don't have to worry about this).There can be numerous preprocessors for each theming hook. Every layer fromcore, modules, engines and themes can have one, each progressively buildingupon the variables before being rendered through template files. This keeps themarkup clean and easy to work with inside templates by placing most of thelogic inside these preprocessors.

    Here are the expected preprocessors. They are run in this order when they exist:

    1. template_preprocess Drupal 6template_preprocess Drupal 7This is supplied by core and always added. Thevariables generated hereareused for every templated hook.

    2. template_preprocess_hookThe module or core file that implements the theming hook supplies this. The

    initial generation of all the variables specific to the hook is usually done here.3. moduleName_preprocess

    Do not confuse this with the preprocessor before it. This allows modules thatdid not originally implement the hook to influence the variables. Applies to allhooks.

    4. moduleName_preprocess_hookSame idea as the previous preprocessor but for specific hooks.

    5. engineName_engine_preprocess- The preprocessor for theming engines. Applies to all hooks.

    6.

    engineName_engine_preprocess_hookAnother preprocessor for theming engines but specific to a single hook.

    https://www.drupal.org/node/223440https://www.drupal.org/node/223440https://www.drupal.org/node/223440http://api.drupal.org/api/function/template_preprocess/6http://api.drupal.org/api/function/template_preprocess/6http://api.drupal.org/api/function/template_preprocess/7http://api.drupal.org/api/function/template_preprocess/7https://www.drupal.org/node/226776https://www.drupal.org/node/226776https://www.drupal.org/node/226776https://www.drupal.org/node/226776http://api.drupal.org/api/function/template_preprocess/7http://api.drupal.org/api/function/template_preprocess/6https://www.drupal.org/node/223440
  • 5/20/2018 Difference Drupal6 Drupal7

    6/21

    7. engineName_preprocessNOT RECOMMENDED. This is the first preprocessor that can be used insidethe theme. It can be named after the theme engine the theme is running under.Applies to all hooks.

    8.

    engineName_preprocess_hookNOT RECOMMENDED. Another preprocessor named after the engine butspecific to a single hook.

    9. themeName_preprocessThis one is named after the theme itself. Applies to all hooks.

    10.themeName_preprocess_hookSame as the previous preprocessor but for a specific hook.There are many possibilities here for modifying the variables. In most cases, itis only the first two preprocessors that exist. The first adds the default baseline

    variables and the second adds a set specific to the theming hook. Contributedmodules taking advantage of the preprocessor slots (3 & 4) should documenttheir behavior. It will not be covered extensively here.

    While it is possible, the default PHPTemplate does not inject itself to this list. (5& 6)Themes can start adding their preprocessors seventh in the list. The preprocessfunction should be added to the theme's template.php file. However, due to the

    problems listed below, it is recommended that themes use their own names asthe prefix (9 & 10). It is possible to grow this list beyond the ten shown above

    by having sub-themes add preprocessors strictly through their theme name as itis shown in the last two examples.

    A few notes: There is an unfortunate design flaw/bug in the theme system when a theme is

    part of a base theme/sub-theme hierarchy. Any preprocess functions prefixedwith engineName_preprocess will be run multiple times (once for each theme inthe hierarchy) instead of just once. Not only is this wasting resources, it can alsocause difficult-to-debug errors.

    The theme name (9 & 10) should always be used forthemes.This minimizes

    any chance of a sub-theme redeclaring a function with anengineName_preprocess prefix and causing fatal PHP errors due to duplicatefunctions.

    Note that nothing should bereturnedfrom these functions and the variableshave to be passed byreferenceindicated by the ampersand before variables,e.g., &$variables.Since the variables set early on are run through all the latter preprocessors dueto references, be careful that you do not inadvertently reset any added before

    your theme. It is fine to reset them, but doing so accidentally can keep youguessing what went wrong.

    https://www.drupal.org/node/225125https://www.drupal.org/node/225125https://www.drupal.org/node/225125http://us.php.net/returnhttp://us.php.net/returnhttp://us.php.net/returnhttp://us.php.net/manual/en/language.references.phphttp://us.php.net/manual/en/language.references.phphttp://us.php.net/manual/en/language.references.phphttp://us.php.net/manual/en/language.references.phphttp://us.php.net/returnhttps://www.drupal.org/node/225125
  • 5/20/2018 Difference Drupal6 Drupal7

    7/21

    Example set from a module implementing the hook of "foo":

    And the preprocessor created from the theme to add to the variable set above:

    The variables that end up in the template file are the keys setwithin $variables. So, with the above example, the variable in the templatewould result in $foo_list.

    When using a preprocessor not specific to a theming hook, a second parametercan be used which always passes the current hook. Using a more specialized

    preprocess function like the one shown above is easier to maintain but if therewill be shared code for multiple theming hooks, you may want to opt for thisinstead.

  • 5/20/2018 Difference Drupal6 Drupal7

    8/21

    }?>

    In Drupal 7, there are two sets of variable process functions. The first is theexisting "preprocess" functions. The second is "process" functions which are

    run after preprocessors. All the various prefixes and suffixes apply to thissecond phase in the exact same way. This is useful when certain variables needto be worked on in two phases. For example, adding classes into an array for the"preprocess" phase then flattening them into a string in the "process" phase, soit's ready to print within a template.

    So effectively they are the same thing but called in different phases. Preprocessfunctions are called first and changes are made then Process functions are thencalled at a later phase and allowed for changes to be make.

    Where to use the theme hook?Ans: template.php in theme folder

    What is use of template.php file?Ans: Overriding other theme functions. If you want to override a theme function not includedin the basic list (block, box, comment, node, page), you need to tell PHPTemplate about it.

    To do this, you need to create a template.php file in your themes directory. This file muststart with a PHP opening tag

    What is subtheme?Ans:A Drupal subtheme (or sub-theme) is a theme that is based on a base theme. The basetheme provides basic (and sometimes more than basic) functionality. The subtheme styles thesite with a unique look, and adds any unique extra functionality.

    Which modules used for data migration?Ans: Feeds https://drupal.org/project/feedsImport or aggregate data as nodes, users, taxonomy terms or simple database records.

    How to handle localization in drupal?Ans: Drupal 7 supports the localization.

    How to use the multiple themes in one project?Ans: use the global variable, default_theme.

    How can prevent or restrict multiple login in drupalAns: Use the Session Limit Modulehttps://drupal.org/project/session_limit

    Session Limit allows administrators to limit the number of simultaneous sessions per

    user.

    https://drupal.org/project/session_limithttps://drupal.org/project/session_limithttps://drupal.org/project/session_limithttps://drupal.org/project/session_limit
  • 5/20/2018 Difference Drupal6 Drupal7

    9/21

    Max session is configurable, no database tables needed.

    By default, a session is created for each browser that a user uses to log in. This module

    will force the user to log out any extra sessions after they exceed the administrator-

    defined maximum.

    Assuming the session limit is 1, if a user is logged in to a Drupal site from their work

    computer and they log in from their home computer, they would be forced to either log

    off the work computer session, or abort their new login from home.

    Features On login, logout the oldest session without prompting (optional)

    At login, prevent login if existing session exists elsewhere (optional)

    Notify old session about disconnect

    Configure any number of max allowed sessions Configure session limiting exclusions by role

    Configure session limiting exclusions by user

    New user session prompted to select which session to disconnect

    Implements hook on collision

    Implements hook on disconnect

    Implements triggers and compatible withrules

    Integrates withtoken module

    DisregardMasqueradeduser sessions in max session counter (optional)

    Other recommended modules

    Autologout- For limiting the length of time a user's session can last. Password Policy- For enforcing password length, complexity and renewal.

    Ejector seat- For periodically checking if a user has been logged out and then reloading the page they are on so

    they know they need to login before proceeding

    While doing the migration how date will be migrated. (is there any with date migration)Ans: There will be issue with date format. It takes only unix time format.

    How can we set the region in drupal theme?

    Ans: You can set the regions in themename.info file. Following is the example:regions[header] = Headerregions[content_header] = Content Headerregions[content] = Contentregions[sidebar_second] = Right sidebar

    How can we improve the Drupal site performance?Ans: Use PHP APC, Use memcache, Use the Varnish. Most important moduleUse theBoost module. Use Views Cache.For very high traffic, Use the CDN module. Use the Block Cache.

    Which database storage engine is used in d6 and d7?Ans: Drupal 6 uses the MYISAM and Drupal 7 uses the INODB

    http://drupal.org/project/ruleshttp://drupal.org/project/ruleshttp://drupal.org/project/ruleshttp://drupal.org/project/token/http://drupal.org/project/token/http://drupal.org/project/token/http://drupal.org/project/masqueradehttp://drupal.org/project/masqueradehttp://drupal.org/project/masqueradehttp://drupal.org/project/autologouthttp://drupal.org/project/autologouthttp://drupal.org/project/password_policyhttp://drupal.org/project/password_policyhttps://drupal.org/project/ejectorseathttps://drupal.org/project/ejectorseathttps://drupal.org/project/ejectorseathttp://drupal.org/project/password_policyhttp://drupal.org/project/autologouthttp://drupal.org/project/masqueradehttp://drupal.org/project/token/http://drupal.org/project/rules
  • 5/20/2018 Difference Drupal6 Drupal7

    10/21

    Which modules are added in d7 core modules?Ans: Following modules are added in d7 core.Entity APIAnother API module which is required by many other modules. This module extends coresentities in lots of useful ways.

    Entity ReferenceCreate relationships between any entities. This is a superior replacement to Node Referenceand User Reference in Drupal 6.MediaAdding media to content was tricky before the media module. This should be installed onevery Drupal 7 site.

    What is left join and right joins?Ans:For the sake of this example, lets say you have 100 students, 70 of which have lockers. Youhave a total of 50 lockers, 40 of which have at least 1 student.

    INNER JOIN is equivalent to show me all students with lockers. Any students without lockers, or any lockers without students are missing.Returns 70 rows

    LEFT OUTER JOIN would be show me all students, with their corresponding locker if theyhave one.This might be a general student list, or could be used to identify students with no locker.Returns 100 rows

    RIGHT OUTER JOIN would be show me all lockers, and the students assignedto them ifthere are any.This could be used to identify lockers that have no students assigned, or lockers that have toomany students.Returns 80 rows (list of 70 students in the 40 lockers, plus the 10 lockers with no student)

    FULL OUTER JOIN would be silly and probably not much use.Something like show me all students and all lockers, and match them up where you canReturns 110 rows (all 100 students, including those without lockers. Plus the 10 lockers withno student)

    CROSS JOIN is also fairly silly in this scenario.It doesnt use the linked lockernumber field in the students table, so you basically end upwith a big giant list of every possible student-to-locker pairing, whether or not it actuallyexists.Returns 5000 rows (100 students x 50 lockers). Could be useful (with filtering) as a starting

    point to match up the new students with the empty lockers.

    How to create the table using module?Ans: Use following code:/*** Implements hook_schema().

    */function module_name_schema() {

  • 5/20/2018 Difference Drupal6 Drupal7

    11/21

    $schema['module_name'] = array(fields => array(type => array(type => varchar, length => 15, not null => TRUE, default =>node),id => array(type => int, unsigned => TRUE, not null => TRUE, default => 0),

    module_name => array(type => varchar, length => 255, not null => TRUE, default=> )),primary key => array(type, id),);

    return $schema;}

    /*** Implements hook_uninstall().

    */function module_name_uninstall() {// Clear variablesvariable_del(module_name_default);

    }

    How to update table using module?Ans: You can check the following code:/**

    * Implements hook_update_n().*/function module_name_update_6200() {$ret = array();

    if (db_column_exists(module_name, id)) {return $ret;}

    db_create_table($ret, module_name_temp, array(fields => array(

    type => array(type => varchar, length => 15, not null => TRUE, default =>node),id => array(type => int, unsigned => TRUE, not null => TRUE, default => 0), module_name => array(type => varchar, length => 255, not null => TRUE, default=> )),primary key => array(type, id),));

    $ret[] = update_sql(INSERT INTO {module_name_temp} (id, module_name) SELECT nid,module_name FROM {module_name});

    db_rename_table($ret, module_name, module_name_old);

  • 5/20/2018 Difference Drupal6 Drupal7

    12/21

    db_rename_table($ret, module_name_temp, module_name);

    $display_settings = variable_get(module_name_display, array());foreach ($display_settings as $type) {if ($type) {

    variable_set(module_name_type_ . $type . _showfield, 1);}}variable_del(module_name_display);

    return $ret;}

    How to drop the table using module?Ans: Use db_drop_table method in install file

    Which hooks you used and what is the purpose of using the those hooks?Ans: You need to give this answer

    What is responsive theme?Ans: A responsive theme (as the one used for this website), is an approach to webdevelopment that allows a website to break itself down smoothly across multiple monitorsizes, screen resolutions, and platforms, be it a computer, tablet or mobile device. It allowsthe developer to create a site that is optimized for each platform, both in navigation,readability and load time.

    As you can see when resizing the window (if you are viewing this site on a computer), thelayout of the page shifts depending on the size of the screen; with different layouts forcontent depending on viewing area. Themes (or layouts) such as this, allow for a single siteand single look to the site, to be viewed on various devices without the need for additionalthemes or resizing by the user.

    How to create the responsive theme?Ans: You can check the following URL:http://www.netmagazine.com/tutorials/create-responsive-drupal-theme http://www.unimitysolutions.com/blog/7-steps-building-responsive-theme-drupal-7

    What is difference between innodb and myIsam?Ans: First major difference I see is that InnoDB implements row-level lock while MyISAMcan do only a table-level lock. You will find better crash recovery in InnoDB. However, itdoesnt have FULLTEXT search indexes, as does MyISAM. InnoDB also implementstransactions, foreign keys and relationship constraints while MyISAM does not.

    What is difference between update and alter query?Ans: ALTER is a DDL (Data Definition Language) statement. Whereas UPDATE is a DML(Data Manipulation Language) statement. One is used to update the structure of the table(add/remove field/index etc). Whereas UPDATE is used to update data.

    What is purpose or use of .htaccess file?Ans: File_HtAccess provides common methods to create and manipulate Apache / NCSA

    http://www.netmagazine.com/tutorials/create-responsive-drupal-themehttp://www.netmagazine.com/tutorials/create-responsive-drupal-themehttp://www.unimitysolutions.com/blog/7-steps-building-responsive-theme-drupal-7http://www.unimitysolutions.com/blog/7-steps-building-responsive-theme-drupal-7http://www.unimitysolutions.com/blog/7-steps-building-responsive-theme-drupal-7http://www.netmagazine.com/tutorials/create-responsive-drupal-theme
  • 5/20/2018 Difference Drupal6 Drupal7

    13/21

    style .htaccess files. These files together with accompanying password files are used toprotect webserver directories. Since File_HtAccess does not provide any means to manipulateor create password files you should use it together with File_Passwd.

    What is use of substr and strstr function?

    Ans: strstrFind the first occurrence of a string. substrReturn part of a string.

    Can we include one php file multiple times?Ans: Yes.

    What is contextual filter?Ans: , contextual filters were called arguments in Views and a lot of documentation, tutorialsand Views-compatible modules still use that term. If you see the term argument, it should beinterpreted either as a contextual filter, or the value provided to a contextual filter.

    How to use the contextual filter?Ans: The classic example of how contextual filter values are provided to views is by the view

    path. If a view has the path example.com/my-view, the URL example.com/my-view/story/22will call the view along with two values for contextual filters (in this case story and 22). Butthere are more ways of providing contextual filter values. These are discussed in Chapterabout Page manager and Panels.

    What is taxonomy?Ans: Taxonomy, a powerful core module, gives your sites use of the organizational keywordsknown in other systems as categories, tags, or metadata. It allows you to connect, relate andclassify your websites content. In Drupal, these terms are gathered within vocabularies.

    The Taxonomy module allows you to create, manage and apply those vocabularies.

    New under Drupal 7 is the ability to add taxonomy fields to vocabularies and terms.

    How to update the drupal?Ans: Easiest way is use update.php file. If you installed the drush then you can use thefollowing command drush pm-update. Do not forget to take file and mysql backup beforeupdate.

    if we delete the page.tpl.php then drupal site will work or not?Ans: Yes. will work. It will check for node.tpl.php file.

    Did you written the query in D7 for your module?Ans: Check following URLhttps://api.drupal.org/api/drupal/includes%21database%21database.inc/function/db_query/7

    db_query($query, array $args= array(), array

    $options= array())

    https://api.drupal.org/api/drupal/includes%21database%21database.inc/function/db_query/7https://api.drupal.org/api/drupal/includes%21database%21database.inc/function/db_query/7https://api.drupal.org/api/drupal/core%21includes%21database.inc/function/db_query/8https://api.drupal.org/api/drupal/core%21includes%21database.inc/function/db_query/8https://api.drupal.org/api/drupal/core%21includes%21database.inc/function/db_query/8https://api.drupal.org/api/drupal/includes%21database%21database.inc/function/db_query/7
  • 5/20/2018 Difference Drupal6 Drupal7

    14/21

    Executes an arbitrary query string against the active database.

    Use this function for SELECT queries if it is just a simple query string. If the

    caller or other modules need to change the query, usedb_select() instead.

    Do not use this function for INSERT, UPDATE, or DELETE queries. Those shouldbe handled viadb_insert(),db_update() anddb_delete() respectively.

    Parameters

    $query: The prepared statement query to run. Although it will accept both named

    and unnamed placeholders, named placeholders are strongly preferred as they

    are more self-documenting.

    $args: An array of values to substitute into the query. If the query uses named

    placeholders, this is an associative array in any order. If the query uses

    unnamed placeholders (?), this is an indexed array and the order must match

    the order of placeholders in the query string.

    $options: An array of options to control how the query operates.

    Return value

    DatabaseStatementInterfaceA prepared statement object, already executed.

    Do you have profile on drupal site? Do you write the comments on Drupal site?Ans: If you have drupal profile then say yes. If not then create profile now.

    Did you contributed the drupal site (any module)?Ans: Try adding some patches or modules to drupal.

    What modules do you always recommend to your clients?Ans: Views, Panels, Ctools, Token, Pathauto, Webform, Rules, Features, Strongarm, Date,view slideshow, Drush, Entity Reference, QuickTab, Libraries, Google Analytics, DisplaySuite, Context, Module Filter, CSS Injector, Diff

    Which files are required for Creating the Drupal Module?Ans: MODULENAME.info and MODULENAME.module file are required for creating themodule.

    Which files are required for Creating the Drupal Theme?

    Ans: .info (declares the theme features) and page.tpl.php (defines the layout)

    How can we add the new Menu to Drupal Admin section?Ans: Use following:

    Navigate to administer > site building > menusSelect the Add menu tab itemFor the title enter Example menu and select to return to the menu list view

    How does caching work in Drupal?Ans: Use this linkhttp://blog.merge.nl/20120118/how-does-caching-work-drupal

    https://api.drupal.org/api/drupal/includes%21database%21database.inc/function/db_select/7https://api.drupal.org/api/drupal/includes%21database%21database.inc/function/db_select/7https://api.drupal.org/api/drupal/includes%21database%21database.inc/function/db_select/7https://api.drupal.org/api/drupal/includes%21database%21database.inc/function/db_insert/7https://api.drupal.org/api/drupal/includes%21database%21database.inc/function/db_insert/7https://api.drupal.org/api/drupal/includes%21database%21database.inc/function/db_insert/7https://api.drupal.org/api/drupal/includes%21database%21database.inc/function/db_update/7https://api.drupal.org/api/drupal/includes%21database%21database.inc/function/db_update/7https://api.drupal.org/api/drupal/includes%21database%21database.inc/function/db_delete/7https://api.drupal.org/api/drupal/includes%21database%21database.inc/function/db_delete/7https://api.drupal.org/api/drupal/includes%21database%21database.inc/interface/DatabaseStatementInterface/7https://api.drupal.org/api/drupal/includes%21database%21database.inc/interface/DatabaseStatementInterface/7http://blog.merge.nl/20120118/how-does-caching-work-drupalhttp://blog.merge.nl/20120118/how-does-caching-work-drupalhttp://blog.merge.nl/20120118/how-does-caching-work-drupalhttp://blog.merge.nl/20120118/how-does-caching-work-drupalhttps://api.drupal.org/api/drupal/includes%21database%21database.inc/interface/DatabaseStatementInterface/7https://api.drupal.org/api/drupal/includes%21database%21database.inc/function/db_delete/7https://api.drupal.org/api/drupal/includes%21database%21database.inc/function/db_update/7https://api.drupal.org/api/drupal/includes%21database%21database.inc/function/db_insert/7https://api.drupal.org/api/drupal/includes%21database%21database.inc/function/db_select/7
  • 5/20/2018 Difference Drupal6 Drupal7

    15/21

    Drupal 7 core. Drupal 6 is similar but works a but differently because page caching

    wassimplifiedfor Drupal 7 (e.g. aggresive mode is now a available as a settings.php var)

    and the entire system also has become pluggable.

    Everybody knows this screen and the settings. But what do they exactly mean? Whatdifference do they actually make? What do they do? Here is an attempt to explain the

    settings at '/admin/config/development/performance'.

    Page caching:

    If enables, page caching will only be used for anonymous users. If you enable page caching, the entire HTML of each page will be stored in the database.

    This significantly reduces the amount of queries needed.

    This automatically means that blocks will also get cached, disregarded their own cache

    settings.

    IfVarnishis configured, this will also enable varnish caching

    The page cache max-age will be used (see below) for each page.

    You can check the "X-Drupal-Cache" HTTP header to check if this cache is HIT.

    Block caching:

    If you enable block caching, without enabling page caching, the block cache settings will

    be used (for anonymous and authenticated).

    The defaults for most blocks is "don't cache" because that is the default for blocks who

    don't have their cache settings specifically declared.

    You can useblock_cache_altermodule to set this for each block.

    When it's block created by Views, you can set the cache settings for a block in Views.

    Minimum cache lifetime:

    http://drupal.org/node/370454http://drupal.org/node/370454http://drupal.org/node/370454http://drupal.org/project/varnishhttp://drupal.org/project/varnishhttp://drupal.org/project/varnishhttp://drupal.org/project/blockcache_alterhttp://drupal.org/project/blockcache_alterhttp://drupal.org/project/blockcache_alterhttp://drupal.org/project/blockcache_alterhttp://drupal.org/project/varnishhttp://drupal.org/node/370454
  • 5/20/2018 Difference Drupal6 Drupal7

    16/21

    This is the amount of time before the page cache is cleared.

    Page caches are cleared on each cron run (system_cron).

    Be warned: incorrect settings of your cron and this setting mightkill your website

    performance.See also thisissue.

    Expiration of cached pages:

    This only applies for external caching mechanisms, for example your browser cache or

    Varnish.

    It sets the Cache-Control max-age value in the HTTP-HEADERS.

    This setting only takes effect when page caching is turned on

    What is the use of taxonomy and vocabulary in Drupal?Ans: Taxonomy, a powerful core module, gives your sites use of the organizational keywordsknown in other systems as categories, tags, or metadata. It allows you to connect, relate andclassify your websites content. In Drupal, these terms are gathered within vocabularies.The Taxonomy module allows you to create, manage and apply those vocabularies.

    How to interact with Drupal search system ?Ans: The search module lets users search for specific content on your site. You can search

    both for users and for particular words. When you are on the content tab of Search, youwill be able to search for words appearing in the default rendering of node content on your

    site, which would include the default rendering of any CCK fields, Location fields,Taxonomy, etc., as well as comments. When you are on the users tab of Search, you will beable to search the user names of registered users on your site, and if you have sufficient

    permissions, also their email addresses.

    What are hooks in Drupal?Ans: hooks are implemented in modules and you can read about the core hooks here:http://api.drupal.org/api/group/hooks/5. Basically they provide a way for a module to extendthe functionality of another module. For example the node module provides the corefeatures of a node (content type). You can use CCK or a custom module to create a customcontent. You can also use the nodeapi hook to extend the functionality of any content type.

    The are core hooks for working with node, users, taxonomy and more. Contributed modulemay also add addition hooks your module can implement.

    How can add the Captcha in registration page for drupal?Ans: Use the captcha and recaptcha module.

    For Image slider which modules are required in Drupal?Ans: use Views slideshow, nivo slider modules. there are other modules also.

    Can I use Drupal on the command line?Ans: Use drush.

    http://api.drupal.org/api/drupal/modules--system--system.module/function/system_cron/7http://api.drupal.org/api/drupal/modules--system--system.module/function/system_cron/7http://api.drupal.org/api/drupal/modules--system--system.module/function/system_cron/7http://www.metaltoad.com/blog/how-drupals-cron-killing-you-your-sleep-simple-cache-warmerhttp://www.metaltoad.com/blog/how-drupals-cron-killing-you-your-sleep-simple-cache-warmerhttp://www.metaltoad.com/blog/how-drupals-cron-killing-you-your-sleep-simple-cache-warmerhttp://www.metaltoad.com/blog/how-drupals-cron-killing-you-your-sleep-simple-cache-warmerhttp://drupal.org/node/891600http://drupal.org/node/891600http://drupal.org/node/891600http://drupal.org/node/891600http://www.metaltoad.com/blog/how-drupals-cron-killing-you-your-sleep-simple-cache-warmerhttp://www.metaltoad.com/blog/how-drupals-cron-killing-you-your-sleep-simple-cache-warmerhttp://api.drupal.org/api/drupal/modules--system--system.module/function/system_cron/7
  • 5/20/2018 Difference Drupal6 Drupal7

    17/21

    What does Views do and how do you use it?Ans:You need Views if:You like the default front page view, but you find you want to sort it differently.You like the default taxonomy/term view, but you find you want to sort it differently; forexample, alphabetically.

    You use /tracker, but you want to restrict it to posts of a certain type.You like the idea of the article module, but it doesnt display articles the way you like.You want a way to display a block with the 5 most recent posts of some particular type.You want to provide unread forum posts.You want a monthly archive similar to the typical Movable Type/Wordpress archives thatdisplays a link to the in the form of Month, YYYY (X) where X is the number of posts thatmonth, and displays them in a block. The links lead to a simple list of posts for that month.Views can do a lot more than that, but those are some of the obvious uses of Views.

    How do you handle upgrades?Ans: use update.php or drush command (pm-update)

    Which module is required for Google, Facebook, twitter login?Ans:

    Which module can be used for E-commerce?Ans: Use ubercart module

    If I want to add the extra fields in registration field then what should we do?Ans: Use profile module. In drupal 7 Profile is in core.

    How can we modify the form validation of Drupal?Ans: Use form alter hook and use this #required => TRUE

    Which are the core required modules in drupal 6.xAns: Check this URL :https://drupal.org/node/1283408

    How to enable clean urls in drupal ?Ans: apache support is needed for this. Then enable from admin.

    What is PDO?Ans:PDO is an acronym for PHP Data Objects. PDO is a lean, consistent way to access

    databases. This means developers can write portable code much easier. PDO is not anabstraction layer like PearDB. PDO is a more like a data access layer which uses a unifiedAPI (Application Programming Interface).

    What is a patch in Drupal and how will we apply patch in drupal?Ans:A patch is a file that consists of a list of differences between one set of files and another.All code changes, additions, or deletions to Drupal core and contributed modules/themes

    between developers are done through patches. The differences are presented in a structured,standard way, which means that a program (also named patch) can be used to apply thechanges to another copy of the original file.

    How to post videos from mobile to Drupal website?Ans: Use the video module. For bigger sites use brightcove module.

    https://drupal.org/node/1283408https://drupal.org/node/1283408https://drupal.org/node/1283408https://drupal.org/node/1283408
  • 5/20/2018 Difference Drupal6 Drupal7

    18/21

    https://drupal.org/project/brightcoveThis is paid service.

    List the SEO modules available in Drupal.Ans: Use following modules

    PathautoNodewords/ Meta tagsService linksGoogle analyticsRelated LinksSearch 404Site mapUrl list

    List the modules required for building a social networking website in Drupal.Ans:

    Advanced Forum Advanced Profile Kit ApplicationToolbar (Appbar) Author Pane Buddylist2 Package Buddylist: list your social network CiviCRM: manage community contacts, relationships, and activities CiviNode and CiviNode CCK: Tools For Integrating CiviCRM Contacts Into DrupalContent Comment Notify FOAF: friends of a friend Facebook-style Statuses Family: Record, display, and analyze genealogical data. Flag Friend Friend FriendList Front: Show group membership and events Gigya Socialize Module Invite: send invitations to join your site Notice Feed

    Organic Group Profile Setup Radioactivity Sports Pickem Tellafriend Node User Invite User Relationships UserTag:Tag

    How To Define New Regions (Sidebar,Header, footer) in Drupal ?Ans:ADD this code in its entirety to the bottom of your template.php file:

    Explain me User, Permission, Role in drupal?Ans:

    Which ORM is used in Drupal 7?

    Ans: Doctrine is the ORM.

    Which Design Pattern used in Drupal?Ans: Singleton Design pattern is used in Drupal.

    What is the use of features module?Ans: The features module enables the capture and management of features in Drupal. Afeature is a collection of Drupal entities which taken together satisfy a certain use-case.

    Features provides a UI and API for taking different site building components from moduleswith exportables and bundling them together in a single feature module. A feature module is

    like any other Drupal module except that it declares its components (e.g. views, contexts,

  • 5/20/2018 Difference Drupal6 Drupal7

    19/21

    CCK fields, etc.) in its .info file so that it can be checked, updated, or revertedprogrammatically.

    Did you used the Panel module? If yes then what is the use of that?Ans: The Panels module allows a site administrator to create customized layouts for multiple

    uses. At its core it is a drag and drop content manager that lets you visually design a layoutand place content within that layout. Integration with other systems allows you to createnodes that use this, landing pages that use this, and even override system pages such astaxonomy and the node page so that you can customize the layout of your site with very finegrained permissions.

    What is the use of Ctools module?Ans: This suite is primarily a set of APIs and tools to improve the developer experience. Italso contains a module called the Page Manager whose job is to manage pages. In particularit manages panel pages, but as it grows it will be able to manage far more than just Panels.

    For Drupal module development code review which module can be used?Ans: Use the thecodermoduble

    Which Drush commands you use while development?Ans: Following drush commands are use useful while development.Drush ccclear cache

    pm-disable (dis) Disable one or more extensions (modules or themes).pm-download (dl) Download projects from drupal.org or other sources.pm-enable (en) Enable one or more extensions (modules or themes).pm-info (pmi) Show detailed info for one or more extensions (modules or themes).

    pm-list (pml) Show a list of available extensions (modules and themes).pm-refresh (rf) Refresh update status information.pm-releasenotes Print release notes for given projects.(rln)

    pm-releases (rl) Print release information for given projects.pm-uninstall Uninstall one or more modules.pm-update (up) Update Drupal core and contrib projects and apply any pending databaseupdates (Same as pm-updatecode + updatedb).

    pm-updatecode (upc) Update Drupal core and contrib projects to latest recommendedreleases.

    For better search what we can do in Drupal 7?Ans: Use theSolr module

    This module provides a Solr backend for theSearch APImodule.The backend uses, like the popularApache Solr Search Integrationmodule,Apache Solrservers for indexing and searching content. It has great performance, is suitable even for useon large commercial websites and supports facets and multi-index searches.

    Requirements

    Requirements are:

    TheSearch APImodule, of course.

    https://drupal.org/project/coderhttps://drupal.org/project/coderhttps://drupal.org/project/coderhttps://drupal.org/project/search_api_solrhttps://drupal.org/project/search_api_solrhttps://drupal.org/project/search_api_solrhttps://www.drupal.org/project/search_apihttps://www.drupal.org/project/search_apihttps://www.drupal.org/project/search_apihttps://www.drupal.org/project/apachesolrhttps://www.drupal.org/project/apachesolrhttps://www.drupal.org/project/apachesolrhttp://lucene.apache.org/solr/http://lucene.apache.org/solr/http://lucene.apache.org/solr/https://www.drupal.org/project/search_apihttps://www.drupal.org/project/search_apihttps://www.drupal.org/project/search_apihttps://www.drupal.org/project/search_apihttp://lucene.apache.org/solr/https://www.drupal.org/project/apachesolrhttps://www.drupal.org/project/search_apihttps://drupal.org/project/search_api_solrhttps://drupal.org/project/coder
  • 5/20/2018 Difference Drupal6 Drupal7

    20/21

    AnApache Solrserver which can be individually configured (or has a configuration

    compatible with this module).

    For further details see themodule's handbook documentation.

    If you do not want to or cannot install your own Solr server, there are a number of web Solrhosts which are compatible with the Search API (either because they have it as an option, orthey allow uploading custom configurations). Some of them are:

    Hosted Apache Solr

    websolr

    gotosolr(free 1-month trial)

    Hosted Solr

    How can Improve the Drupal cache and logging?Ans: Use theMongodb module

    integration for Drupal. This is a collection of several modules which allow sites to storedifferent types of Drupal data in MongoDB.

    Views integration provided byEntityFieldQuery Views Backend.

    Module D6 D7 D8 Description

    mongodb_cacheStore cache in MongoDB.D6 requirespatch.Please help to test!

    mongodb_field_storage Store fields in MongoDB.

    mongodb_sessionStore sessions in MongoDB.D6 requirespatch.Please help to test!

    mongodb_watchdogStore watchdog messages in MongoDB.Includes Top 403/Top 404 reports as in dblog

    mongodb_blockStore block information in MongoDB. Very close to thecore block API.

    mongodb_queueDrupalQueueInterface implementation using MongoDB.D6 requirespatchand depends onDrupal Queuemodule.Please help to test!

    mongodbSupport library for the other modules. In D8, it includessupport for Flood, Key/Value, Route.

    What is Content Construction Kit (CCK) in Drupal

    The Content Construction Kit allows you to add custom fields to custom content types usinga web interface. In Drupal 5.x, custom content types can be created in Drupal core, and theContent Construction Kit allows you to add custom fields to any content type. In Drupal 7and later, most of the functionality of CCK has been absorbed into Drupal core.

    Summary and purpose of CCK?

    http://lucene.apache.org/solr/http://lucene.apache.org/solr/http://lucene.apache.org/solr/https://www.drupal.org/node/1999280https://www.drupal.org/node/1999280https://www.drupal.org/node/1999280http://hostedapachesolr.com/http://hostedapachesolr.com/http://websolr.com/http://websolr.com/http://www.gotosolr.com/en/http://www.gotosolr.com/en/https://www.hosted-solr.com/https://www.hosted-solr.com/https://drupal.org/project/mongodbhttps://drupal.org/project/mongodbhttps://drupal.org/project/mongodbhttp://drupal.org/project/efq_viewshttp://drupal.org/project/efq_viewshttp://drupal.org/project/efq_viewshttp://drupal.org/node/1098268http://drupal.org/node/1098268http://drupal.org/node/1098268http://drupal.org/node/1007974http://drupal.org/node/1007974http://drupal.org/node/1007974http://drupal.org/node/1179738http://drupal.org/node/1179738http://drupal.org/node/1179738http://drupal.org/project/drupal_queuehttp://drupal.org/project/drupal_queuehttp://drupal.org/project/drupal_queuehttp://drupal.org/project/drupal_queuehttp://drupal.org/node/1179738http://drupal.org/node/1007974http://drupal.org/node/1098268http://drupal.org/project/efq_viewshttps://drupal.org/project/mongodbhttps://www.hosted-solr.com/http://www.gotosolr.com/en/http://websolr.com/http://hostedapachesolr.com/https://www.drupal.org/node/1999280http://lucene.apache.org/solr/
  • 5/20/2018 Difference Drupal6 Drupal7

    21/21

    Drupal comes with core content types like story and blog. For such a content type, go to'Create content' and submit a new story or blog. That's sufficient for pages of pure text andwith or without attachments.

    But what if your users want to be able to submit reviews of their favorite aardvark? That

    would be a new content type, but I want to be able to display other stuff as well as a chunk oftext for every node of that type, and I don't want it to be just attached file links.

    My options: I could hack the story.module, OR I could see if someone has already created anaardvark.module for the exact type of content I want, OR using CCK I could create a newcontent type called Aardvark Review.

    Using CCK, I can create a content type that has exactly the fields I need, no more or less. MyAardvark Review for instance might have:

    text field (comments on the aardvark)

    dropdown menu (aardvark color)

    audio file (recording of the aardvark's grunting)

    image (photo of aardvark)

    The CCK admin interface for creating these new content types is nice and easy: just createyour new type and then click through, adding the type of fields you want it to have and whattheir parameters will be (how much text for the review? which colors in the dropdown

    menu?). There are many add-ons available in the downloads section under CCK that add newkinds of fields to your options (video field, audio field, calculated values and vastly morecomplicated ones).

    From the users' perspective, they'll just click on Create content > Aardvark Review and get aform that asks them to submit their review, the aardvark's color, a recording, and picture.