Questions tagged [debugging]

Use it for questions about module and theme debugging (e.g. "How do I debug this situation?").

Filter by
Sorted by
Tagged with
39
votes
9answers
56k views

How do I enable developer/debug mode?

Installing drupal 8 core (using standard profile). whenever I get exception/error, I get blank page with "The website has encountered an error. Please try again later." (as below image) text and no ...
38
votes
7answers
9k views

Is there a good way to inspect objects whose type is derived from the EntityDrupalWrapper class?

I'm sure this question applies to other complex object types, but EntityDrupalWrapper is the one I'm currently working with. This is the type of object returned by entity_metadata_wrapper() (and ...
36
votes
4answers
7k views

How do I debug permissions?

How do I debug permissions in Drupal 7? I use core reporting, error logs, devel module error logs, backtrace and node access permission block but sometimes it is not enough. What else should I check ...
31
votes
12answers
69k views

“The website encountered an unexpected error. Please try again later.”

I get this error with Drupal 7. The website encountered an unexpected error. Please try again later. How can I get more information about this error? Is there any report or log to understand what ...
27
votes
6answers
15k views

Debug EntityFieldQuery?

I have a module which is misbehaving. An EFQ is returing unexpected results, but I can't see why just by looking at the code. Is there a dpq() equivalent for EFQs? Other ways of debugging them?
23
votes
9answers
37k views

dpm() does not display any results on screen

I have the same problem as file_scan_directory() takes about 10 seconds to execute. I just tried the dpm(func_get_args()) suggestion, and unfortunately it doesn't show anything to me. I've cleared ...
20
votes
4answers
13k views

How to generate a stack trace upon errors

I am sysadmin trying to debug a Drupal site. In my server logs I can see Drupal making the same requests again and again to our Solr instance until PHP eventually runs out memory, and Apache returns a ...
18
votes
3answers
14k views

How to debug EntityMalformedException?

I've got fatal error EntityMalformedException: Missing bundle property on entity of type node. in entity_extract_ids() (line 7700 of .\includes\common.inc) when trying to access user/xyz. I tried to ...
18
votes
1answer
21k views

Install and Configure XHProf (Ubuntu)

Problem I'm trying to use XHProf but I'm getting horrible php error every time it runs. Warning: Invalid argument supplied for foreach() in xhprof_compute_inclusive_times() (line 1670 of /var/www/...
14
votes
1answer
3k views

Is there any alternative to devel themer?

I am using Theme developer module for theming. The module is pretty good, but still it is very buggy. Is there a less buggy alternative?
12
votes
1answer
10k views

Where are logs created by drush_log() stored?

I have installed Devel module to use xhprof. In devel settings, I have enabled xhprof, but when I load a page, can't see a link to xhprof. I read the source and found this: drush_log('xhprof link: ' ....
10
votes
5answers
7k views

Missing “Clean URLs” option

I have a new installation of Drupal 7. I was having a problem with administrative overlay URLs having URL encodings in them, which I asked about here. Another user suggested I confirm that I have ...
9
votes
4answers
10k views

execute drush command from devel/php drupal

Can any one please tell me how can I execute drush command from devel/php? I can execute PHP codes from devel/php. But I don't know how can I execute drush command from devel/php. (As we know "devel/...
9
votes
4answers
7k views

How to configure XHProf on windows?

With the help of Lorenzo Alberton tutorial, i get XHProf installed for drupal 6 on linux server. Now i need to get it installed on windows but i found that XHProf cant be installed on windows. ...
9
votes
1answer
9k views

dump() not working in Drupal 8 (blank page, debbugging is enabled)

I want to use dump() in my .twig template (inside custom theme). The problem is, when I place {{ dump() }} the page is just blank. I have had: Set twig.confing debug: true in services.yml. Cleared ...
9
votes
4answers
6k views

Can Xdebug be triggered by Drush commands?

I'm running into an issue with my Features modules and installation profile when installing the site with drush si. There are a number of probably related issues in the Features issue queue, but none ...
9
votes
1answer
3k views

Debugging hooks that fired?

I'm somewhat new to module development. Is there a way to currently output what hooks have been run on certain nodes? Would this be done with xdebug?
8
votes
4answers
1k views

How to make use of Devel debugging functions on large or complex objects

I am having trouble making real use of Devel's debugging functions kint() and dpm() in my modules and twig templates. They work fine for primitive variables, flat arrays and such, but if I want to ...
8
votes
3answers
14k views

How to use the dsm( ) Devel function to print the $form array of my form?

I want to use the dsm() function of the Devel module to print the $form array of a form, where the form_id is search_theme_form. How to do that?
8
votes
3answers
6k views

Devel dsm() function in Drupal 8 page.html.twig

Is Devel module's dsm() function available in page.html.twig? If it is not available, is there a way to make it available? I am able to use dsm() in .theme file but not in page.html.twig. I am ...
8
votes
2answers
5k views

krumo()/dpm() not working

I have a custom module and a template to alter the appearance of my node submission forms, á la these instructions. My module consists of three functions: A hook_form_alter() that works fine A ...
7
votes
4answers
8k views

Debugging #AJAX and FormAPI

What is the easiest way to view current '$form_state' variables while working with #ajax? is there a way I can get dpm() to update automatically on each ajax load? If it matters, I'm testing ajax on ...
7
votes
8answers
10k views

How do I print the SQL query of a view in front end?

I have installed latest Drupal 8.1.1 also Devel module installed there is no any option for Display query log on devel setting page while it's present on D7 Devel module. I have created a view with ...
7
votes
2answers
1k views

Find slowest loading / longest time to generate pages

Is it possible to find pages that take the longest time to generate? I am aware Devel can collect query log per page, but is there a module that collects these per page and displays a list of slowest ...
7
votes
2answers
422 views

Drupal Settings for PHPStorm

I want to try to work with PHPStorm Debug. I already installed debug on my Mac and changed the php.ini File. Furthermore, I installed the Debug Helper for Chrome and created a Projekt on PHPStorm. ...
7
votes
1answer
582 views

Is there any 'advanced' debugging available for Views?

I know Views can show you an SQL preview, various performance statistics, and other SQL queries performed for live previews; I'm looking for something a bit closer to the bone. The use case... I'm ...
6
votes
4answers
6k views

Devel module and Krumo

I super love Krumo/Devel. However, I'm sure I'm missing something obvious, because when I use dsm() and I get my array or object all expandable and awesome, sometimes I have a hard time knowing which ...
6
votes
3answers
3k views

Drupal 8 devel dpm does not expand Drupal\node\Entity\Node

I'm getting a feeling that Devel got pretty much useless with D8. When I try to dump most of the drupal objects I get only (Object) Namespace\Class output. No fields data is printed. print_r is able ...
6
votes
3answers
3k views

Why is ddebug_backtrace coming up blank?

I've been using the Devel module for a couple of years now but every time I try to get a backtrace I run into issues. I remember getting it working once, but I don't remember how. It seems like ...
6
votes
1answer
2k views

How to stop twig debug from breaking HTML when inside tags?

Originally this was in a views field rewrite but i have since moved it to views-view-fields--[view name]--[machine ID].html.twig And behaviour seems to be the same: <a href="{{ fields.path....
6
votes
1answer
3k views

Debug “Access Denied”

Is there a way for debugging "Access Denied" errors in Drupal 8? I'm having some routing/permission issues, and I would like to be able to debug why i'm getting "Access Denied".
6
votes
3answers
523 views

How to get drush to work with xdebug — may have recently broken

I've been using drush with xdebug for years. It looks like it broke in the last two weeks, possibly due to modifications made to the core "drush" script (Split 'drush' script into finder, wrapper and ...
6
votes
1answer
1k views

What is the difference between the Load and Render objects in Devel?

When viewing a Node in the Devel tab, what are these different objects Load and Render? How and where would I have access to them in the theme layer?
6
votes
2answers
8k views

How can I output the Devel query log?

Is it possible to output the Devel generated query log in some way? By default, it prints to the bottom of the page which is fine until I need to send the results to someone else to review.
6
votes
1answer
4k views

Devel kpr, dpr, dpm, etc. only print after cache flush

I'm writing a small module and using the Devel print functions (dpr, kpr, dpm, etc.) to print out some values. However, I only see the values in the page after I flush certain caches. if I just ...
6
votes
2answers
1k views

Can't get drush script to stop at breakpoint with Xdebug/Phpstorm

I had this working on another Drupal VM, but for some reason I can't get it to work anymore. I am trying to debug a Drush migration script and I have some breakpoints put in but it never stops at the ...
5
votes
3answers
15k views

In Drupal 7 how do you output array objects to be view able in watchdog error reports?

For some reason I couldn't use devel to debug output object arrays. Is there a way to output the array data to watchdog error reporting? This would also solve the issue of having to install or enable ...
5
votes
5answers
4k views

Let anonymous view dpm() when using Omega subtheme

I need to debug a D7 site from the anonymous user. What settings need to be changed to allow anonymous to view dsm(), dpm(), krumo(), etc. commands? Note: I have already enabled Access developer ...
5
votes
1answer
738 views

How to show messages starting with “Debug : ” to an administrator only?

I'm developing a lot of complex rules in D7 and for debugging reasons it is very handy to have different messages (the standard Drupal message) within the website. For this I use "showing a message on ...
5
votes
2answers
6k views

How do I know what variables are available for a theme function?

I am using the Menu block module. In one template I have used kpr($page); to see what hooks the menu block is calling. I then created the correct function in my theme's template.php file ...
5
votes
1answer
3k views

how to render html link within dsm message?

I would like to include a link to the reports page within a dsm message. Here is what I tried: $loglink = l("logs", 'admin/reports/dblog'); $msg= "See $loglink for watchdog messages"; dsm ($...
5
votes
1answer
681 views

Copy path to variable in array using Kint

In D7 using dmp() with Krumo in produced output like this: Double clicking on a variable value, in this case "foobar" shows the path through the array to that value (the highlighted text in the image ...
5
votes
2answers
750 views

Debug plugin discovery

A plugin that I have written is not being discovered. For eg : https://www.drupal.org/node/2847639 Is there a general suggestion for debugging failing plugin discovery?
5
votes
1answer
309 views

Module to list menu_router / path debug info? [closed]

Every now and then, mostly when looking at a new site, I find myself wanting to know What's the source of this particular page? Usually, I end up starting to dig in the menu_router table, and ...
5
votes
1answer
217 views

How to know which module is responsible for each database query?

I enable the devel module and set it to Display query log. Then on every page load I get a list of the generated sql queries. You can see an example of that list in the capture I uploaded. So far so ...
5
votes
1answer
648 views

How can I debug Simpletests for a custom module?

I am struggling to debug PHPUnit Tests (with xdebug) in a custom D8 Module from PHPStorm or via the command line. Is it possible to do this? I'm running an Acquia Bolt generated site on a Drupal-VM ...
4
votes
3answers
3k views

How can I see my drupal site as a anonymous user while logged in as admin?

I want to use Devel Themer to look at the "homepage" comment field, but it only shows up for anonymous users. Is there anyway to see a page as a anonymous user would, and at the same time be logged ...
4
votes
2answers
528 views

Can kint be used to debug templates?

Normally, I can use kint() in the place of dump() to debug my twig templates. The theming manual agrees. However, this doesn't work for me in Commerce 2. In commerce-product.html.twig, I added {{ ...
4
votes
1answer
540 views

Devel output on hooks called during cron run

I'm implementing a hook that is called if certain conditions are met during a cron run. (Specifically hook_bounce_mails_blocked($mails) from the Bounce module) The hook is triggered, but any output ...
4
votes
1answer
2k views

{{ kint() }} leads to install.php

Just on certain pages, I'm led instead to /core/install.php... This has happened to me a great number of times now, in certain twig templates. But, I can't imagine why. Has anyone else had this ...

1
2 3 4 5
11