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) »
  • Backtracing in 3.2 - has anything changed?
Pages: [1]

Author Topic: Backtracing in 3.2 - has anything changed?  (Read 672 times)

alanms

  • I post occasionally
  • **
  • Posts: 72
  • Karma: 5
Backtracing in 3.2 - has anything changed?
August 07, 2010, 02:46:51 pm
Crazy question - but has backtracing been changed in Civi 3.2? With debugging options enabled in Global Settings, I just can't get &backtrace=1 to show anything in either a page or in page source code.

I'm adding &backtrace=1 to a Civi URL with debugging enabled in Global Settings. I've tried this on two seperate, relatively fresh 3.2 installs, trying it with and without {debug} included in the .tpl file, and I've even tried it on the CiviCRM demo page and sandbox. (like a polite guest I closed the debugging behind me :)

If you want to replicate this: I'm turning debugging on in the Civi demo site at http://drupal.demo.civicrm.org/civicrm/admin/setting/debug?reset=1 then adding &backtrace=1 to a page url, e.g. http://drupal.demo.civicrm.org/civicrm/dashboard?reset=1&backtrace=1. It shows up exactly the same as it does without &backtrace=1 with identical source code. Alternate debugging URL commands such as http://drupal.demo.civicrm.org/civicrm/dashboard?reset=1&smartyDebug=1 work fine. I even tried with &backTrace=1 just in case...

Have I missed a step? Does something need to be reset or flushed? Maybe I'm misunderstanding something - e.g. does backtracing only work on certain pages? The way it is described on the wiki, it sounds like a really useful tool to find out what code is behind any Civi function; but on the forums, it's normally talked about in the context of imports and fatal errors.

My expectation was to see something similar to the backtrace visible on the "civicrm backtrace" google result http://janicehahncitycouncil.com/civicrm/profile/create?reset=1&gid=4 minus the non-recoverable error notice.

(p.s. if anyone is feeling super helpful, the reason I'm trying to use backtrace is to find out what the code is that dictates which smarty variables are available on pages such as 'Delete contact' and 'Tags', in order to display the name of the contact these actions will apply to. I'm looking for a way to load in contact names as usable smarty variables, along with the already available {$contactId}. Any suggestions of better ways to do this would also be gratefully received! It feels like it should be a trivial task to simply add a contact name to a page that already has the contact ID loaded)

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Backtracing in 3.2 - has anything changed?
August 07, 2010, 07:55:49 pm

the backtrace is shown ONLY when we need to report a fatal error. in  cases where there is no error the backtrace parameter is fairly useless :(

since i am feeling super helpful (does help that one kid is asleep and the other is half asleep), the easiest way to do it is:

1. implement the hook hook_civicrm_buildForm (or hook_civicrm_pageRun, depending on whether its a form or not)

2. take the contactID and retriee the display name:

CRM_Contact_BAO_Contact::getDisplayAndImage

3. expose the display name to smarty (using $template->assign)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Backtracing in 3.2 - has anything changed?

This forum was archived on 2017-11-26.