Jump to content


Photo

NullPointer while exporting reports to CSV

reports export csv null pointer

  • Please log in to reply
3 replies to this topic

#1 knucKles

knucKles

    Member

  • Members
  • PipPip
  • 23 posts
  • LocationHamburg

Posted 31 October 2013 - 09:40 AM

Hello!

 

We have a report that lists all companies and corresponding contacts so that we have a list of all phone numbers and eMail addresses available. Some company entries do not have a contact linked to it because we only have a general phone number of the company and no direct dialing or a specific contact.

 

When trying to export the report to a CSV file, an error occurs. After taking a look into the logs it was clear why.

 

In /zurmo/app/protected/modules/reports/adapters/FullNameForReportToExportValueAdapter.php line 43 you try to parse a model into an array. When the customer is null, the model is null and the whole thing crashes.

 

I did a quick fix in line 42 by changing

if ($model->id > 0)

into

if ($model != null && $model->id > 0)

et voilĂ  - works like a charm! :)

 

The export is still veeery slow but hey, at least it works now. :)

 

Hopefully you consider this bugfix for the next release.

 

Best regards,

  ~knucKles



#2 raysto

raysto

    Zurmo Team

  • Administrators
  • 1,973 posts

Posted 31 October 2013 - 02:16 PM

Thank you so much for finding this bug. You can track the fix here.


Ray Stoeckicht
Zurmo Team
Try Zurmo Pro


#3 speixoto

speixoto

    Advanced Member

  • Members
  • PipPipPip
  • 386 posts

Posted 01 November 2013 - 12:38 PM

Hi knucKles,

 

Can you please replicate the issue in our demo instance? Or at least point me to the details of the report you made? What are the attribute columns, etc..



#4 raysto

raysto

    Zurmo Team

  • Administrators
  • 1,973 posts

Posted 06 November 2013 - 05:07 PM

Hello!

 

We have a report that lists all companies and corresponding contacts so that we have a list of all phone numbers and eMail addresses available. Some company entries do not have a contact linked to it because we only have a general phone number of the company and no direct dialing or a specific contact.

 

When trying to export the report to a CSV file, an error occurs. After taking a look into the logs it was clear why.

 

In /zurmo/app/protected/modules/reports/adapters/FullNameForReportToExportValueAdapter.php line 43 you try to parse a model into an array. When the customer is null, the model is null and the whole thing crashes.

 

I did a quick fix in line 42 by changing

if ($model->id > 0)

into

if ($model != null && $model->id > 0)

et voilĂ  - works like a charm! :)

 

The export is still veeery slow but hey, at least it works now. :)

 

Hopefully you consider this bugfix for the next release.

 

Best regards,

  ~knucKles

This issue has been resolved and will be fixed in 2.5.2


Ray Stoeckicht
Zurmo Team
Try Zurmo Pro






Also tagged with one or more of these keywords: reports, export, csv, null pointer

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users