Drupal modules weights - để quản lý and execution order

Drupal modules weights - để quản lý and execution order

One of the good features that Drupal offers to the developer is the module execution order. Out of the box, Drupal has a mechanism to allow it to execute module's hooks in predefined order based on modules weight (order). If you check your Drupal installation's database, there will be a table in your database called system, in this table Drupal stores all the modules and themes (core and contributed) information, including their execution order which is visible in the weight column.

Drupal modules weights - để quản lý and execution order

Most of you developers, found your selves in a situation where some of you custom code is not working. Well, most of the time this issue is caused by some other module overriding what you did, or that your module is not executing in the "layer" it should.

To solve this issue, I used to just go directly to my MySQL client and update the module's weight in the systemtable. But..... What if you don’t have access to the database? What if you do want a nicer way to see the order in which modules are executed?

To solve this issue you might consider using Modules Weight module, this module allows the admins or the webmaster with privilege to access the administration page of this module and modify the modules weight as he/she wishes with a drag-drop feature.

Note: This module by default doesn't display the core modules, that's because displaying core modules in the configuration form will reorder the system core modules execution even if you didn't change them! And as some might notice all core modules has to have 0 weight value by default.

Bạn thấy bài viết này như thế nào?: 
No votes yet
Ảnh của Tommy Tran

Tommy owner Express Magazine

Drupal Developer having 9+ year experience, implementation and having strong knowledge of technical specifications, workflow development. Ability to perform effectively and efficiently in team and individually. Always enthusiastic and interseted to study new technologies

  • Skype ID: tthanhthuy

Tìm kiếm bất động sản

 

Advertisement

 

jobsora

Dich vu khu trung tphcm

Dich vu diet chuot tphcm

Dich vu diet con trung

Quảng Cáo Bài Viết

 
JSON hay XML - API nào tốt nhất trong Drupal

JSON hay XML - API nào tốt nhất trong Drupal

Bottom line: unless you are targeting a consumer who you know depends on XML, your best bet is to go with JSON.

5 tính năng và thủ thuật cho Safari 5 Hidden Features and Tricks of Safari

5 tính năng và thủ thuật cho Safari 5 Hidden Features and Tricks of Safari

Safari là một trình duyệt web tốt, có tốc độ lướt web nhanh, có nền tảng là WebKit và mang lại nhiều tính năng tuyệt vời của Apple

App Store, Apple, iTunes Store

Apple mở cửa iTunes Store tại châu Á và Việt Nam

Apple vừa chính thức mở cửa iTunes Store đến 12 quốc gia mới tại châu Á - Thái Bình Dương, tạo điều kiện để người dùng có thể mua sắm, thưởng thức âm nhạc, phim ảnh... trên cửa hàng trực tuyến này.

Công ty diệt chuột T&C

 

Diet con trung