Details
-
Type: Improvement
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.7.23, 4.6.32
-
Fix Version/s: 4.7.25
-
Component/s: CiviReport
-
Labels:
-
Versioning Impact:Patch (backwards-compatible bug fixes)
-
Documentation Required?:None
-
Funding Source:Contributed Code
-
Verified?:No
Description
Change civicrm_report_instance, report_id from 64 characters to 512 characters to match civicrm_option_value, value to avoid errors caused by truncating CiviCRM report name which are greater than 64 chars.
As a result, when a new report is created based on a custom report template which has a name greater than 64 characters. The stored report_id is truncated when the new report instance is created. The truncated report_id does not match the corresponding template from which it was created, which causes CiviCRM to throw errors like:
- You have tried to access a report that does not exist.
- Could not find template for the instance.'
For example, if I have a custom CiviCRM report with a report_url of au.com.agileware.constituentsummarymembershiptypereport/constituentsummarymembershiptype
CiviCRM will store only the first 64 characters of new report instances as the report_id: au.com.agileware.constituentsummarymembershiptypereport/constitu
And since this error does not actually indicate what the true nature of the problem is, this can waste a lot of time trying to solve and is very frustrating.
There should possibly be a warning in CiviCRM somewhere as well which reports or otherwise informs developers that CiviCRM cannot use reports which have names greater than X characters.
So for this issue, I recommend just increasing the size of the report_id field so that it matches the civicrm_option_value, value field, which is varchar 512.
Agileware Reference CIVICRM-283