Sunday, February 26, 2012

Drupal : Notice: Undefined index: Return-Path in DefaultMailSystem->mail()

Notice: Undefined index: Return-Path in DefaultMailSystem->mail() (line 101 of C:\xampp\htdocs\Drupal\sis\modules\system\system.mail.inc).
Solution :
-----------------------------------------------------------------------------------
You have problem on "site_mail" row in variable table. Maybe you change its value.
This is site_mail row:  |'site_mail'   |'s:20:\"emsiemhong@gmail.com\";'|
For more information go to link below:
https://drupal.org/node/131737
-----------------------------------------------------------------------------------

Drupal : Warning: implode() [function.implode]: Invalid arguments passed in DefaultMailSystem->format()....

Warning: implode() [function.implode]: Invalid arguments passed in 
DefaultMailSystem->format() (line 23 of C:\xampp\htdocs\Drupal\sis\modules\
system\system.mail.inc).
Solution:
-------------------------------------------------------------------------
DefaultMailSystem->format() expects the message body to be an array. 
Currently, the message body is given as a string.
-------------------------------------------------------------------------

Saturday, February 25, 2012

Drupal 7: Call function from another module different from the .module file

Should be load the module first before call the function :   
module_load_include($type, $module, $name = NULL);
-----------------------------------------------------------------
Example:
<?php
// Load node.admin.inc from the node module
module_load_include('inc', 'node', 'node.admin');
?>
---------------------------------------------------

Drupal 7: Strict warning: Only variables should be passed by.....

Drupal 7: Strict warning: Only variables should be passed by reference in
order_example_info_page() (line 33 of C:\xampp\htdocs\Drupal\
commerce_kickstart\sites\all\modules\commerce_examples\order_example\
order_example.module).
------------------------------------------------------------------------------------
Example block code:
function order_example_info_page() {
 $output = drupal_render(drupal_get_form('order_example_form'));
 return $output;
}
Change to:
function order_example_info_page() {
 $form = drupal_get_form('order_example_form');
 $output = drupal_render($form);
 return $output;
}
-------------------------------------------------------------------------------------