I have created new module for drupal 7. please let me know if any issue identified by anybody

Comments

spandanareddy62’s picture

StatusFileSize
new75.24 KB

Problem loading the page for the path mentioned under Profile CSV export menu.Find the attachment of screen shot of the error message.

drupalfox’s picture

Can you tell me the procedure you use to install module. I think clean url are not enabled in your ubuntu machine. Please enable it and let me will it solve your problem.

Thank you

pinky.goyal’s picture

Notice: Undefined index: data in _profile_csv_format_user() (line 234 of /home/quickstart/websites/example7.dev/sites/all/modules/profile_csv/profile_csv.module).

getting this warning once I export.

Thanks,
Pinky

kenorb’s picture

Issue summary: View changes
Status: Active » Needs work
kenorb’s picture

Status: Needs work » Needs review
StatusFileSize
new4.49 KB

Few improvements.

Changes:

diff --git a/profile_csv.info b/profile_csv.info
index 5611d8d..5d88e9d 100644
--- a/profile_csv.info
+++ b/profile_csv.info
@@ -2,5 +2,4 @@ name = Profile CSV
 description    = Allows exporting profile data in Comma Separated Values (CSV) format.
 dependencies[] = profile
 core           = 7.x
-files[] = profile_csv.module
 
diff --git a/profile_csv.module b/profile_csv.module
index 8c8878f..68b59cb 100644
--- a/profile_csv.module
+++ b/profile_csv.module
@@ -13,6 +13,9 @@
 define('PROFILE_CSV_ROLE',           'profile_csv_role');
 define('PROFILE_CSV_PERM_DOWNLOAD',  'download profiles');
 
+/**
+ * Implements hook_help().
+ */
 function profile_csv_help($path, $arg) {
   $output = '';
   switch ($path) {
@@ -23,6 +26,9 @@ function profile_csv_help($path, $arg) {
   return $output;
 }
 
+/**
+ * Implements hook_menu().
+ */
 function profile_csv_menu() {
   $items = array();
 
@@ -44,7 +50,9 @@ function profile_csv_menu() {
   return $items;
 }
 
-//menu callback function
+/**
+ * Implements menu callback.
+ */
 function profile_csv_admin_settings() {
  $form['extra'] = array(
     '#type'        => 'markup',
@@ -124,6 +132,7 @@ function profile_csv_admin_settings() {
   $result = db_query("SELECT pf.fid, pf.name, pf.title, pf.category
     FROM {profile_field} pf
     ORDER BY pf.category, pf.weight, pf.title");
+
   foreach ($result as $row) {
     $fld = PROFILE_CSV_PARAM . 'profile_' . $row->fid;
     if (!isset($form[$set][$row->category])) {
@@ -144,7 +153,9 @@ function profile_csv_admin_settings() {
   return system_settings_form($form);
 }
 
-//menu callback function
+/**
+ * Implements menu callback.
+ */
 function profile_csv_page() {
   // This is needed because with sites with 10s of 1,000s of users
   // the setting for PHP (e.g. 96MB or 128MB) is not enough. Instead
@@ -204,7 +215,7 @@ function profile_csv_page() {
  */
 function profile_csv_permission() {
   return array(
-    'PROFILE_CSV_PERM_DOWNLOAD' =>  array(
+    PROFILE_CSV_PERM_DOWNLOAD =>  array(
       'title' => t('Access the csv download'),
     ),
   );
@@ -229,7 +240,7 @@ function _profile_csv_get_profile_fields() {
 }
 
 function _profile_csv_format_user($uid = 0) {
-  $data="";
+  $data = '';
   $user_data = _profile_csv_get_user($uid);
   $profile_data = _profile_csv_get_profile($uid, $user_data['data']);
   unset($user_data['data']);