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
2
votes
3answers
610 views

How can I display the value of a variable inside a condition?

I have created a rule using the Rules UI. My rule is not working, and I need to debug it, displaying the values of my variables inside a condition where I make a comparison. I see within Rules ...
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 ...
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 ...
3
votes
3answers
7k views

What is easiest way to debug variables in nodes, views, blocks and page twig templates?

What is easiest way to debug variables in nodes,views,blocks and page template. Earlier we used devel module in drupal 7 ,by using dpm() function it shows very neat and clean structure ,it was so ...
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 ...
39
votes
9answers
57k 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 ...
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 ...
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 ...
4
votes
2answers
3k views

How to debug a rule that doesn't want to fire?

I have nodes that can be flagged with a global flag. When a node is updated I want a rule to unflag that node. Rules Event: After updating existing content Rules Action: Unflag a node. I then select ...
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?
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/...
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 {{ ...
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 ...
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 ...
5
votes
1answer
310 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 ...
2
votes
1answer
6k views

Calling a field in views-view-fields--view-name.tpl.php -— Error

I am trying to call a field by using the line of code: <?php print $field->handler->view->field['title_1']; ?> But i keep getting this error: I used devel dpm() to look for what was ...
0
votes
1answer
1k views

getting around recursion when dumping a node?

I'm working on a template and I'm using kpr() from devel to look at the values defined in $variables. One of them is the node in question, and what gets displayed is a big infinity sign indicating ...
3
votes
2answers
1k views

How to debug Batch API more efficiently?

I've some issues with Feeds importing (I don't want to focus on particular case) and I'd like to find the way of able to debug Batch API processing more efficiently. Given the fact of complexity of ...
1
vote
1answer
108 views

How to extract query placeholders for debug purposes?

When I cast query to string, I can see WHERE that will be passed to the database, like this: WHERE (idProperty = :db_condition_placeholder_0) AND (idCategory = :db_condition_placeholder_1) But ...
0
votes
2answers
488 views

Is there any SIMPLE way to hide errors ONLY for anonymous users?

In almost all the times I searched for literature about disabling system errors\bad-notifications ONLY for anonymous/non-admin users, the result was large-scale discussions with seemingly pretty ...
0
votes
1answer
46 views

CCK field migration reproducibly results in server error on node display

I am trying to migrate my CCK types to Fields using CCK module in D7, using content_migrate, following the documentation. After migrating all fields of a certain content types, I got a server reset ...
2
votes
3answers
3k views

How can I have the JS/CSS cache refresh on every page load?

How to clear cache on every page load? I am doing CSS & JS theming and currently having to manually clear cache (using devel module) every time and then reload the page again to see my changes? ...
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 ...
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: ' ....
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?
4
votes
1answer
418 views

posting a comment on cached page

I am a bit confused now - is it normal behavior that posting an anonymous comment on cached page invalidates ALL cached pages for whole site for current anonymous user? Beacouse that is exactly what I ...
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 ...
10
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 ...
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 ...
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 ...
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....
1
vote
2answers
658 views

How to get a backtrace in Drupal, without problems like out-of-memory when huge objects are in the trace?

I often have problems with the standard backtracing functions when working with Drupal: debug_print_backtrace(); often seems to get lost between pages and never prints, Drupal's objects and classes ...
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 ...
3
votes
2answers
3k views

How to generate the function stack trace of the last request made?

Is there a module that can essentially show you the function stack trace of the last request made? Say I have a form that I submit. After the page loads with the result from the request, I would ...
2
votes
2answers
952 views

How to debug views_handler_field_node_revision handler?

I believe I have updated some of my modules, then the following debug message pop on the calendar page. Does anyone know what is this message and how to solve it? Debug: 'Handler ...
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
1answer
650 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 ...
3
votes
4answers
192 views

Why do modules have bug reports?

A good question was raised in this comment by EGHDK: Why do these modules have bug reports. Shouldn't this be a simple task for a module to complete with no errors? He was referring to limiting ...
2
votes
1answer
453 views

How to make Drush rsync @dev @staging exclude some directories?

I am using the following drush commands to synchronize development and test environments. drush rsync @dev @staging drush sql-sync @dev @staging How to setup drush to exclude certain directories (...
1
vote
2answers
1k views

Messed Up Drupal Site, truncated all cache, menu_router, registry_file and now I can't access site

After disabling comment module, I could not access some modules, so I researched how to get that fixed and end up following this. I cleared all the cache_table, menu_router and registry_file. This ...
1
vote
2answers
2k views

How do I check the content of variables passed to a template file?

I enabled Twig debug and I tried to debug some custom fields. However, if I try this with debug() or kint(), my application always crashes. My PHP memory size is currently 512MB; I assume that should ...
4
votes
1answer
3k views

Is there an AJAX command I can use to debug PHP variables without breaking AJAX call?

I know the list of Ajax framework commands. Every one of them is doing something useful. But sometimes I want, for debug, include a piece of debug data in my AJAX response. I want it to be unobtrusive,...
3
votes
2answers
2k views

page.tpl.php override for Panels Pages?

I want to use a specific tpl.php file for all Panels Custom pages. I get some formatting issues if I try to use "Panels Everywhere" module, so would like an alternative.
3
votes
1answer
344 views

How to troubleshoot Rules when a required variable for an event is not provided?

I'm seeing a strange behavior on my site and I'm trying to figure out how to correct it. I have a rule that triggers on the event After updating an existing user account. This rule uses two ...
3
votes
1answer
252 views

Output array data on drush error when showing stack trace

I'm trying to install a module, but its giving me errors during a drush enable. It shows the stack trace log and I can see it has something to do with the flag_lists_type during the install process. I ...
3
votes
1answer
332 views

l() is not being called correctly in menu.inc

I had been getting this error message: PHP Fatal error: Unsupported operand types in /var/www/www.ruv.is/pressflow/includes/common.inc on line 1588 So I did a backtrace and this is what it ...
2
votes
2answers
250 views

How can I stop the Devel module from generating blog/forum entries for Anonymous user?

I'm using Devel's generate content feature to generate Blog/Forum entries for a site I'm working on and funny enough, I get to have a blog post by an anonymous user or forum topic by an anonymous user....
1
vote
2answers
183 views

Maintenance page being rendered as an entire page load after the main page load

I've noticed that I've got a maintenance page being rendered in its entire HTML markup format after my pages. The site is not in maintenance mode, and this is not intentional behaviour. I'm trying to ...
1
vote
0answers
199 views

PHP Fatal error: Cannot redeclare twig_without() [closed]

Getting the below error after I tried to install new modules to D8. [error] 32411#32411: *31 FastCGI sent in stderr: "PHP message: PHP Fatal error: Cannot redeclare twig_without() (previously ...
1
vote
2answers
428 views

Trying to get property of non-object in i18n_langcode() (line 229 of i18n.module) and a bunch of other property of non-object notices

Recent logs lies to me. I even did a dpm($node->title); with devel and indeed it's there. I have like 6 pages of these notices that appear per page load. They are all different locations but ...