Blogz

Recent Blogz

Bidirectional Relationship Support in JSON

Ever tried to create a JSON data structure that includes entities that have a bidirectional relationship (i.e., circular reference)? If you have, you’ve likely seen a JavaScript error along the lines of “Uncaught TypeError: Converting circular structure to JSON”. Or if you’re a Java developer who uses Jackson library, you may have encountered “Could not write JSON: Infinite recursion (StackOverflowError) with root cause java.lang.StackOverflowError”. This article provides a robust working approach to creating JSON structures that include a bidirectional relationship without resulting in these errors.

A brief introduction on AngularJS

AngularJS is a JavaScript MVC framework developed by Google that lets you build well structured, easily testable, and maintainable front-end applications. If you haven’t tried AngularJS yet, you’re missing out. The framework consists of a tightly integrated toolset that will help you build well structured, rich client-side applications in a modular fashion—with less code and more flexibility.
AngularJS extends HTML by providing directives that add functionality to your markup and allow you to create powerful dynamic templates. You can also create your own directives, crafting reusable components that fill your needs and abstracting away all the DOM manipulation logic.

AngularJS is a JavaScript MVC framework developed by Google that lets you build well structured, easily testable, and maintainable front-end applications. If you haven’t tried AngularJS yet, you’re missing out. The framework consists of a tightly integrated toolset that will help you build well structured, rich client-side applications in a modular fashion—with less code and more flexibility.
AngularJS extends HTML by providing directives that add functionality to your markup and allow you to create powerful dynamic templates. You can also create your own directives, crafting reusable components that fill your needs and abstracting away all the DOM manipulation logic.

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.