There are alot of guides that teaches you how to hide fieldgroups with
hook_form_alter function. However, those only works on in-built fieldgroups, such as Author Information.
Here's a very useful function that actually hides custom fieldgroups which you have created from the Field UI:
When you are creating a new user programatically with user_save, you would also need to manually programatically create the profile2 type for the new user account if you are using Profile2. The following code should solve the problem:
There wasn't any clear guide or documentation on how to add a select list which allow users to select multiple value in a Rules condition. The following code should work just fine:
Look for your DataDir of your website and remove the particular month of the file. In our case, we are using Virtualmin that installs the AWStats and by default the DataDir of the site is stored in
/var/www/awstats/[site-domain]. For example, if the site domain is gix.my, the directory that stores all the AWstats data files would be in
/var/www/awstats/gix.my. You may want to backup that folder first before you start to do anything with the files. Make sure that you have the old log files that needs to be processed by AWStats.
In a theme's node.tpl.php, we can easily render a field view using Drupal's
For example, we have a field name field_integer with the label My integer. To display the field in the node.tpl.php, we can just call it out using
render($content['field_integer']);, which will display like the following (Assuming it is the default manage display setting for the field):
However, what if you want to render the field in your custom module? You won't be able to use
Is your Amazon EC2 having the similar problem below?
fsck died with exit status 8
failed (code 8).
*File system check failed.
A log is being saved in /var/log/fsck/checkfs if that location is writable.
Please repair the file system manually.
*A maintenance shell will now be started.
CONTROL-D will terminate this shell and resume system boot.
Give root password for maintenance
(or type Control-D to continue):
Here's a very useful regular expression cheatsheet which I've found, and it may be very useful to those who are not really familiar with regular expression, especially for PHP's
If you have use Field-Collection module (http://drupal.org/project/field_collection), you would know how useful it is when you need to create a node with grouped value. However, due to how field-collection utilizes Entity API, you will not be able to programmatically update its value directly. Here's a great example on how you could do so:
Suppose 'field_page_collection1' is the field collection for the 'page' content type having two text fields 'field_page_collection1_text1', 'field_page_collection1_text2'.
[ERROR] /usr/sbin/mysqld: Can't open file: './database/table.frm' (errno: 24)
If you are facing this irritating problem, which not only took me hours to figure it out but also caused a little panic because it wasn't fixed although I rebooted the MySQL and the server itself - do not worry as this can be fixed very easily!