CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Custom PHP file not being executed, but template for the same is?
Pages: [1]

Author Topic: Custom PHP file not being executed, but template for the same is?  (Read 638 times)

DaveFF

  • I post occasionally
  • **
  • Posts: 54
  • Karma: 5
  • Developer at Future First
    • Future First
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.34
  • MySQL version: 5.5
  • PHP version: 5.3
Custom PHP file not being executed, but template for the same is?
November 05, 2014, 07:44:23 am
We have some activity types we want to merge or phase out, and some that are only meant to be created automatically by webforms or parts of our custom code. I've been trying to customise CRM_Activity_Form_ActivityLinks to hide the ability to add new activities of these types.

Doing this in custom PHP (would be sites/default/civicrm_custom_php/CRM/Activity/Form/ActivityLinks.php on our system) doesn't work for me- adding a watchdog at the start of the commonBuildQuickForm function reveals that the custom file isn't even being executed. (Have cleared cache, checked for syntax errors etc.)

Taking the corresponding template (sites/default/civicrm_custom_templates/CRM/Activity/Form/ActivityLinks.tpl) and doing a jQuery solution instead works fine.

Can certain core code not be overridden by custom PHP?
Do Not Contact Until extension: https://civicrm.org/extensions/do-not-contact-until
Organisation Name De-duplicator extension: https://civicrm.org/extensions/organisation-name-de-duplicator

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Custom PHP file not being executed, but template for the same is?
November 06, 2014, 02:57:39 am
They can all be.  Do you have other files that are being overridden OK?

If so, maybe there are some obvious typos, differences in file permissions between the two.

If not, are you sure that the custom php directory is correctly defined, etc.
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Custom PHP file not being executed, but template for the same is?
November 09, 2014, 07:37:46 am
Quote from: Michael McAndrew on November 06, 2014, 02:57:39 am
If not, are you sure that the custom php directory is correctly defined, etc.

Yes, test this first with another custom file, to assure that it works.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

DaveFF

  • I post occasionally
  • **
  • Posts: 54
  • Karma: 5
  • Developer at Future First
    • Future First
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.34
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Custom PHP file not being executed, but template for the same is?
November 10, 2014, 05:09:51 am
Never mind, we went with the jQuery version in the end but when I tried again it worked. Thanks for your input.
Do Not Contact Until extension: https://civicrm.org/extensions/do-not-contact-until
Organisation Name De-duplicator extension: https://civicrm.org/extensions/organisation-name-de-duplicator

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Custom PHP file not being executed, but template for the same is?

This forum was archived on 2017-11-26.