[Vtigercrm-developers] Bug in Report Generator with vtlib modules?
Alan Lord
alanslists at gmail.com
Mon Apr 22 06:56:40 UTC 2013
On 22/04/13 05:15, Prasad wrote:
> 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.
lol -
I have managed to narrow down the issue but I'm still getting failures
on 2 type 10 fields. One added to the Accounts module (using vtlib) for
a link to Vendors, the other in my custom module which is a link to
Accounts.
The removal of underscores from all my strings seems to have fixed the
report headers and field labelling issue but when I add either of these
two fields to a report the report still fails with either:
> Report generation failed
> Unknown column 'vtiger_vendorRelAccounts1114.vendorname' in 'field list'
or
> Report generation failed
> Unknown column 'vtiger_accountRelAccounts.accountname' in 'field list'
Other UIType 10 fields seem to be working fine and all other fields seem
fine - it only appears to be an issue with these UIType10s.
If I break the label string in the relevant vtiger_selectcolumn the
report runs and that UIType 10 column is populated, but only with the
entity's ID values, not the actual Vendor or Account name.
I will carry on digging into this today but it's driving me nuts! I
think I must have done something really daft somewhere and "can't see it
for looking" - maybe sleep and fresh eyes will help ;-)
Cheers
Al
>
> *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
> <mailto: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/
>
>
>
>
> _______________________________________________
> http://www.vtiger.com/
>
More information about the vtigercrm-developers
mailing list