I am using 4.7.13 on two different sites. On one site, when I update the class and refresh my custom report, all of the changes are visible. On the other site when I do the same thing, the changes are not visible. Even stranger, when I delete the class (i.e., the PHP file), the report is still visible in its old form. I have tried 'flush all cache' and searching for any other cached versions without success. Since this works on one site but not the other I suspect there is some configuration setting that I am missing somewhere.
3 Answers
It sounds like you may have an override file in place. Check Administer » System Settings » Directories to get the custom PHP path, then look in the appropriate subfolder (if it exists) for an override file.
-
The override file is where I have placed my new class which is based on the Sybunt class, but it has a different classname and filename. This directory is the only place this class should exist.– R DoomanMar 13, 2017 at 19:31
-
I am still having difficulties with this. Once a class has been registered, it never gets updated. My only recourse is to change the class name and filename by appending a suffix. I should not have to do this.– R DoomanMar 22, 2017 at 0:15
-
1Issue was traced to opcache, which was running on one site, but not the other. Followed the instructions here (ma.ttias.be/how-to-clear-php-opcache) to clear the cache and that resolved the problem.– R DoomanMar 29, 2017 at 15:06
-
@RDooman Thank you for reporting back! Feel free to post that as a separate answer here and mark it "accepted". It will help others and get you some upvotes. Mar 29, 2017 at 15:42
Issue was traced to opcache, which was running on one site, but not the other. Followed the instructions here (ma.ttias.be/how-to-clear-php-opcache) to clear the cache and that resolved the problem.
One word - pseudoconstants. Put clear_cache=1 in a call in the CiviAPI and see what happens.
-
Maybe my mention of flushing the cache was misleading. Since my new code is not being invoked at all, I'm not sure how adding a call would do anything. I can tell it is not being invoked because I add a field in the __construct() function, and that field does not appear in the 'Columns' tab of the report. I am modifying the out-of-the-box CRM_Report_Form_Contribute_Sybunt class, which as far as I can tell doesn't have any CiviAPI calls anyway.– R DoomanMar 12, 2017 at 14:24
-
Same applies. Give it a go in an API call outside that class, i.e. with the API explorer.– JohnFFMar 12, 2017 at 14:41
-
This had no impact. Executed the following from API explorer: $result = civicrm_api3('Contribution', 'get', array( 'sequential' => 1, 'clear_cache' => 1, ));– R DoomanMar 12, 2017 at 15:54