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
1
vote
1answer
2k views

what when displaying a variable with kint crashes?

I am trying to find the variable name for the content link in a view. {{ kint(content) }} makes the page crash, probably because the variable is too big. The same is true for the following code. ...
0
votes
2answers
2k views

dump $variables in theme_preprocess functions

In theme_preprocess functions (e.g. theme_preprocess_block, theme_preprocess_menu, etc) there is the $variables argument. In Drupal 7 I could look at this variable using devel module and typing dpm($...
0
votes
1answer
49 views

captcha.module error

I've just installed recaptcha module and it works fine but I get this error only at the sign up screen (registration screen). Does anyone know what can I do to fix it?? The error: Notice: Undefined ...
0
votes
0answers
332 views

Access taxonomy fields on page.html.twig [duplicate]

I have added a header image field to most of my entities of my website so that the header image can be overwritten if needed. On any node, my code in my page.html.twig file works perfectly: {% if ...
0
votes
1answer
53 views

Devel Krumo outputting all variables in a list format and not in an expandable clickable list

When I do a dpm() on an array my devel krumo output is showing a list of the variables. Previously it was in a clickable expanding list where I can hide and show the child arrays. What settings did I ...
0
votes
1answer
79 views

How to debug invalid plugins derived by the GraphQL module?

I'm currently using the GraphQL module in combination with the Brightcove module. When I visit /graphql/explorer, all I'm getting is a totally white screen. When I visit /graphql/voyager, I end up ...
1
vote
4answers
146 views

How to find which module is causing PHP warning

In the Recent log messages I get this message repeated many times: Warning: array_flip(): Can only flip STRING and INTEGER values! i DrupalDefaultEntityController->cacheGet() (rad 388 av C:\...
1
vote
1answer
207 views

Problem in deploying Drupal 8 application

I am trying to deploy a Drupal 8 application to another folder from development. Using PGSQL as database server. I have database named xyz. I am copying that database to another one named abc. The ...
1
vote
1answer
86 views

What's wrong with this simple debugging code?

Spend whole day trying to make working simple debugging code for Tweme theme (using D8). function tweme_preprocess_node(&$variables) { $node = $variables['elements']['#node']; kint($node)...
0
votes
1answer
180 views

How to utilise watchdog or how to debug webform error

I have a webform that integrates into CiviCRM such that the webform is used to save data into the Civi system. The following error is generated when hitting submit (although data is saved in the ...
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 {{ ...
0
votes
1answer
32 views

Help solve this error: Class CommerceLicenseEntityController does not exist

When I install the Commerce Licence module, in D7, I get this error. I think it might have to do with my Drupal installation, I'm not sure. What steps can I take to find out what causes this? The ...
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 ...
-1
votes
1answer
67 views

Ho to use devel on commerce_cart_order_refresh or similar

I want to implement the solution on this link Alter cart unit price and total amount. I want to use dpm on devel to look for available fields on line items but I doesnt show on. Code that I used: ...
0
votes
1answer
604 views

Access Value of variable content in twig template

I'm new in a Drupal 8 and using Devel kint() function for debugging. In my twig template menu--main.html.twig, I have looped for the menu items like this:- {% for item in items %} {{kint(item.url)}...
2
votes
1answer
6k views

How can I disable or hide warnings and errors shown in the backend?

Is there a way to disable or hide warnings and errors shown in the backend? For example when a user creates a node and some error occurs on the live page (image or helper class not found), then there ...
2
votes
1answer
535 views

How to use kpr() or dsm() when i am not logged in

I need to access my login form array using kpr() and dsm() functions but it's not working when I logged out from the site. How to debug and access the login form array as logged out.
0
votes
1answer
409 views

What is the difference between KPR() and DSM()

I am learning advanced theming for which I am using Devel Module kpr() and dsm() functions to print the arrays on the page for finding variables. So I want to know, What is the main difference between ...
3
votes
1answer
250 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 ...
1
vote
0answers
34 views

Reaction rule raises TypeError

I have a working Drupal 8.3.7 installation and use the rules3.0alpha module. I add a reaction rule that is applied After saving new comment. That's all. Now, when I try to save a comment, I get an ...
-1
votes
1answer
253 views

Ajax fields do not work on custom page with `drupal_render`

From my module test I render the create node form on URL admin/test using the following: function test_menu() { return array( 'admin/test' => array( 'title' => 'test', 'access ...
1
vote
1answer
237 views

Website returning 404 and not 403 for forbidden pages

My site is returning a 404 error for users who have tried to access a restricted page. I understand that this can be seen as a useful security features, however, I would like to return a 403 error ...
1
vote
3answers
1k views

how can I debug theme.theme file in my theme using phpstorm?

I want to set breakpoints in the theme.theme file and debug some variables but I cannot do that as this file isn't a php file. How can I debug this file?
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 ...
2
votes
1answer
4k views

Drupal 7.54 DATE_RFC7231 already defined

After moving my Drupal site to a new host, I got the following error in the error logs. [error] 8707#0: *1 FastCGI sent in stderr: "PHP message: PHP Notice: Constant DATE_RFC7231 already defined ...
1
vote
2answers
193 views

How to access all of the properties related to Commerce Line Item entity in a rule?

I wonder how I can access all of the line item properties in Rules? For example in a Rules event "Before saving a line item" I can show a debug message of the line item. It has different properties ...
1
vote
0answers
127 views

Unable to install / enable SimpleTest

When I try to install SimpleTest via Extend > Testing > Install, I get the following error: The testing framework requires the sites/simpletest directory to exist and be writable in order to run ...
1
vote
1answer
987 views

How do I use Xdebug?

I have enabled Xdebug in my PHP installation and tried it with Drupal 7. I am interested in profiling, which function runs how many times and where are called (whole tree). There are php.ini settings: ...
-1
votes
1answer
66 views

Unable to render media from nid:******. Error: No file Id

I'm using node_embed module to embed nodes into the body of my main content type. This works fine but whenever I save a node with embedded nodes within its body I get the notice Unable to render media ...
-1
votes
1answer
34 views

PHP functions only called once?

I have written a tiny module with a custom block. The contents of the block is created in the build() function. That function creates the HTMl, which is rendered. I can see that code changes have ...
1
vote
1answer
390 views

Xdebug w/ PhpStorm

I'm using drupal server to use the built-in PHP server when building my Drupal 8 site. I have xdebug set up and I'm using phpstorm. Both work. The only small issue is that every time I start a ...
1
vote
1answer
186 views

Use webprofiler to see entire query from view [closed]

I am using Drupal 8. I have webprofiler enabled and am trying to see the entire query from a view since the query that shows on the view is not the complete view, its missing some fields. How do I use ...
0
votes
1answer
868 views

How to use dd(debug_backtrace()); for an error debugging?

I have this exact error on my site. I am trying to troubleshoot the error using dd(debug_backtrace()); through the Devel module as is described on the link above. Being the noob on developing I can't ...
0
votes
1answer
161 views

error: Fatal error: Class 'Drupal\syslog\Logger\SysLog' not found in /lib/Drupal/Component/DependencyInjection/Container.php on line 272

I just activated the module syslog in an almost fresh D8 install and now it has crashed. =( How do I deactivate a core module like this manually or fix the issue?
0
votes
1answer
101 views

Getting “Page Not Found” After Enabling the Devel Module Drupal 7

I'm trying to install the Theme Developer which requires the Devel module. I've downloaded the Devel module via the Install new Module page in Drupal. When I enable the module however, I get ...
0
votes
1answer
363 views

How do I access values using kint()?

I am porting a module from Drupal 7 to Drupal 8. I was debugging using kint(). I am using hook_user_presave($account) and trying to access the values of $account using kint($account). kint() is very ...
0
votes
1answer
19 views

Instructive message when a module is disabled accidentally

Site breaks without a warning when code of a non-enabled module is called. (In my project I disabled accidentally a module, while the code is executed by another module.) The correct way is to add ...
0
votes
1answer
5k views

“Twig_Error_Loader: Template ”file.html.twig“ is not defined” for new twig template file

After creating a new paragraph type and its template file in the correct folder location, I am receiving the following error every time I view the page with that houses the new paragraph type. ...
0
votes
1answer
967 views

How to get error messages to display on the form, rather than after the page is refreshed?

I have a form that has radio buttons and the user needs to select at least one option. If they do, a modal window will pop-up. If they don't, I need to redisplay the form with the saved values and the ...
1
vote
1answer
34 views

How can I find all the listeners or subscribers to the KernelEvents:REQUEST event?

More specifically, how could I find the subscribers performing the routing system for Drupal? We tried using ddebug_backtrace(), but I couldn't get anything.
1
vote
4answers
995 views

How to debug a variable in a controller class (var_dump)

I am trying to do a var dump from a Drupal 8 Controller class. This is not working because controllers need to send a response. I just need to see the contents of a variable and I have not idea how to ...
0
votes
1answer
28 views

Finding and display custom user variables

I have create a series of user fields. Some of these fields reference taxonomy terms, require a mobile number or are just basic text fields. I used the below to print one of the fields (the number ...
0
votes
2answers
1k views

Is there any template debugging technique similar to Twig debugging?

David Rothstein pointed out in the comments that as of Drupal 7.33, this functionality has been back-ported to Drupal 7. Is there any template debugging technique similar to Twig debugging?
0
votes
2answers
8k views

The website encountered an unexpected error. Please try again later (WSOD). Debugging scenario

After updating Drupal using drush my website says 'The website encountered an unexpected error. Please try again later'. with white screen(WSOD). Then when I tried to rebuild-cache using drush there ...
0
votes
1answer
2k views

500 (Service unavailable (with message)) on login or register

Effectively the same as this (Drupal 500 Internal server error on login page) but i am unable to bump or comment so resorting to adding my own question. The site is running Drupal 7.54 php version 7 ...
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 ...
1
vote
0answers
122 views

'unexpected error' when visiting any page the first time, but not the second

Quite suddenly, my site has begun behaving erratically. No matter whether the page is an admin page, or a page using my custom theme I receive the 'unexpected error' page whenever I visit the page for ...
0
votes
1answer
270 views

Proper debugging of REST Resource due to cache

I'm creating some REST routes for my custom resources and I'm having some trouble with the debugging aspect of development. Every time I change the resource's code, should I need to XDebug it, I need ...
3
votes
3answers
3k views

Enable Twig debug doesn't work?

Why isn't the Twig debug working on my Drupal 8.2.6 site? This is the folder structure. These are the folder permissions. This is the content of the settings.php file. $settings['hash_salt'] = '...
1
vote
1answer
157 views

Why can't I run krumo() on a node page?

I called krumo() inside hook_node_load(). function mymodule1_node_load($nodes, $types) { krumo($nodes); } It works on my front page, but not on a node page. I get this error message: Fatal ...

1
2
3 4 5
11