Blogz

Recent Blogz

Drupal 7: Updating Administrator password programatically

There are several chances by accident we will forget administrator password for the Administrator. The newer version of Drupal core comes with the salt algorithm to encrypt the password. To update the new password we need to encrypt them before an update. The below is the example and syntax for update password. Add the below code in index.php above menu_active_handler().

Drupal 7 : Loading Order Details from LineItem ID

The Line Items in Drupal commerce used to refer the product in Order. Using the Line Item id we can able to load order details. The function commerce_line_item_load() will contains respective order ID of the order. We can able to get the order details from order ID using the function commerce_order_load().

Drupal 7: Programmatically update Commerce Line Item

In Drupal Commerce is an entity reference to the order during order creation. The line item will refer the product in the order. We can able to programmatically update the line item using the function "entity_metadata_wrapper()". The below example will show how to update the line items programmatically.

Revisions in Drupal 8.

Revisions in Drupal 8 comes as a part of core. Every time when you edit or create a content in Drupal 8 you will be provided with an option to create a of that content or page. This is helpful for the process of revert back to the older content.