[support] Eclipse PDT, xDebug and Drupal .tpl.php files

Anth malkouna at yahoo.com.au
Wed Jun 2 08:37:13 UTC 2010


Hi Moses,

If you're getting your debugger to stop at all then most of your setup 
must be fine.  Are you sure that your node-product.tpl.php is being 
called?  Maybe throw a print_r or something in it to make sure.  I know 
that I have seen bugs around node template suggestions not being used 
unless node.tpl.php is in the same file.  If the only command is 
terminate then all server side processing is done usually.  Is the page 
rendering?

You won't see anything in the browser until Drupal has finished 
processing everything, this is mainly because all the work goes into 
building up an output string and the last thing that index.php does is 
basically just write that string out.  At this point control goes back 
to the browser until something (a page navigate or a submit) sends 
control back to the server and it all goes through it again.  It will 
only then stop if where you're sending it to has a breakpoint set up.

I'm pretty sure it has to be a php file, but don't quote me on that.  I 
think I once tried to get it to launch to a html file for a non Drupal 
project but didn't have much luck.  The main reason it's index.php that 
needs to be called is that index.php does a call to drupal_bootstrap so 
that all it's variables and database access is set up so calling to 
another file wouldn't really work.

HTH.
Anthony.

On 6:59 AM, Moses Elias (2) wrote:
>
> I am an Eclipse PDT newbie, so apologies if my questions are basic.
>
> THE ENVIRONMENT
> ================
> I have set up Eclipse PDT 2.1.3 with xDebug and I am trying to debug a 
> Drupal application with LAMPP on Ubuntu via my localhost. I have 
> installed the Drupal Plugin for Eclipse.
>
> I have set breakpoints in page-front.tpl.php and page.tpl.php and the 
> debugger stops in the files where expected.
>
>
> THE PROBLEM
> ============
> However, I have set a breakpoint in a node-product.tpl.php file 
> (derived from node.tpl.php) but when I click Run > Resume and I 
> navigate to the correct page in the browser window, the debugger just 
> refuses to stop execution in it. At this point under Run, the only 
> command highlighted is Terminate, so I don't know where in the 
> application I am at present.
>
> If the application is still executing, how do I break out of the loop 
> and get back control so I can start debugging?
>
> Secondly, I am not certain why I am not able to get into that file and 
> perhaps there's a good reason I am not aware of. This is my primary 
> aim here.
>
> Also, my Firefox External browser opens when I initiate a debug 
> session, but there doesn't seem to be a relationship between Run > 
> Step Over (F6) and what I see in the browser window. The browser is 
> expecting user input. How do I coordinate between the browser and the 
> Eclipse IDE so it's interactive between the two? An action in one 
> makes it pause or continue in the other. That means, when I click in 
> browser window, it should show me where I am in the debugger.
>
> I have one more question. When I start a Drupal debugging session most 
> people set up the Run > Run Configurations to start at index.php. My 
> question is can I start a debug session at some arbitrary URL address 
> or does it always have to begin with a .php file? How about a .tpl.php 
> file located not in the htdocs folder, but in the theme folder itself? 
> Should it be a .tpl.php file, or can it be a URL address?
>
> I know these are basic questions, but any leads would be appreciated.
>
>
>


More information about the support mailing list