[Vtigercrm-developers] Bug in Report Generator with vtlib modules?

Prasad prasad at vtiger.com
Mon Apr 22 04:15:26 UTC 2013


>
> The problem stems from the amazingly convoluted bit of string-theory-type
> code (pun intended) between lines 124 and 139 in ReportRun.php that is
> working field labels...


I hate this legacy fix ... but will there until we change the meta-data
structure.
We will revisit in our during Report module tuning.

*Connect with us on: *Twitter <http://twitter.com/vtigercrm> *I*
Facebook<http://www.facebook.com/pages/vtiger/226866697333578?sk=wall>
 *I* Blog <http://blog.vtiger.com/>* I*
Wiki<http://wiki.vtiger.com/index.php/Main_Page>
 *I *Forums  <http://forums.vtiger.com/>*I* Website <http://vtiger.com/>


On Sun, Apr 21, 2013 at 8:37 PM, Alan Lord (News) <alanslists at gmail.com>wrote:

> I did some further digging.
>
> It looks like I can't use "_" (or "-") in a field label string.
>
> But changing the string to use either a space or nothing between words
> works fine!
>
> It makes translatable labels look a bit odd for my liking but I can live
> with it I suppose. It would be nice if "_" worked though - it's a very
> commonly used string separator - even for vtiger's own labels like in
> module block names etc.
>
> The problem stems from the amazingly convoluted bit of string-theory-type
> code (pun intended) between lines 124 and 139 in ReportRun.php that is
> working field labels...
>
> Cheers
>
> Al
>
>
>
> On 21/04/13 13:40, Alan Lord (News) wrote:
>
>> Hi all,
>>
>> I've recently built some custom modules for a client and we've now
>> noticed that the report engine is broken.
>>
>> If I create a new report that contains a UIType 10 field in my module,
>> the query that is generated gets totally mangled and this appears in the
>> middle of the report query:
>>
>>  (CASE WHEN libertus_lscontracts.supplier NOT LIKE '' THEN (CASE WHEN
>>> vtiger_**vendorRelLSContracts1094.**vendorname NOT LIKE '' THEN
>>> vtiger_**vendorRelLSContracts1094.**vendorname ELSE '' END) ELSE '' END)
>>> AS LSContracts_LBL_LSSUPPLIER
>>>
>>
>> (1094 is the fieldid in vtiger_field)
>>
>> This seems to be linked to the fact I've used language files so the
>> field labels are translatable, In vtiger_field, in the above example,
>> the field vtiger_lscontracts.supplier has a label of LBL_LSSUPPLIER. The
>> translation is in my module dir in both an en_us and an en_gb language
>> file:
>>
>>      'LBL_LSSUPPLIER' => 'Supplier',
>>
>> Now oddly, when I am creating the report the left column where first you
>> select the fields is translated.
>>
>> But in the vtiger_selectcolumn table, the columnname field is stored
>> like this:
>>
>> libertus_lscontracts:supplier:**LSContracts_LBL_LSSUPPLIER:**supplier:V
>>
>> And when you re-examine (customise) the report the right column of the
>> field selection is *not* translated nor are the columns of the report
>> output.
>>
>> The non-UIType 10 fields seem to work OK when I run a report but if I
>> include a UItype 10 field, the report fails because of the mangled query
>> above.
>>
>> If I edit the columnname field of the report of the database and change
>> the string to:
>>
>> libertus_lscontracts:supplier:**LSContracts_Supplier:supplier:**V
>>
>> Then the report runs fine and that CASE WHEN query string above doesn't
>> get generated at all.
>>
>> Can someone explain what is going wrong here?
>>
>> I'm not sure if it is a problem during the initial saving of the report
>> where the translation is not being saved, or in report retrieval whereby
>> the column is not getting translated properly.
>>
>> I've been looking through some of the code in modules/Reports but it's
>> rather convoluted to say the least. I *think* the issue occurs in
>> ReportRun.php function getQueryColumnsList() but if this is the cause or
>> a symptom of something else I'm not sure.
>>
>> Cheers
>>
>> Al
>>
>>
>>
>>
>> --
>> Libertus Solutions
>> http://www.libertus.co.uk
>>
>> ______________________________**_________________
>> http://www.vtiger.com/
>>
>>
>
> --
> Libertus Solutions
> http://www.libertus.co.uk
>
> ______________________________**_________________
> http://www.vtiger.com/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20130422/2fdf7c5b/attachment.html>


More information about the vtigercrm-developers mailing list