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
0
votes
0answers
25 views

How do I debug what causes a null timestamp?

I created a fresh Drupal 8.9.13 site and migrated a Drupal 6 site into it. In particular, there are nodes with revisions. It works correctly. I created a fresh Drupal 8.9.17 website. I repeated (I ...
-1
votes
1answer
55 views

After upgrade to Drupal 9.2: Call to undefined function escapeshellcmd(). Why?

When I want to submit a form (webform module) I get get the followng error: Call to undefined function Drupal\Core\Mail\Plugin\Mail\escapeshellcmd() in Drupal\Core\Mail\Plugin\Mail\PhpMail::...
0
votes
0answers
23 views

Permissions suddenly changed

I've inherited a drupal 7.6 site with a broken css (styles were not loading). Here's what I've done so far: -set sites/default/files, tmp and cache folder to 777. -flushed all caches When this didn't ...
-2
votes
1answer
42 views

The website encountered an unexpected error. Please try again later. unable to debug

I have just moved a Drupal 7 site to a new server. The website loads ok but if I log in as an admin person and click on any of the admin menu options I get the error The website encountered an ...
2
votes
2answers
27 views

Strange Page not Found, Permissions, Clear cache

On my D7.80 I have developed a custom module: function wrong_answer_menu() { dd('it entered in hook menu'); $items['wrong-answer/%id'] = array( 'title' => t('Wrong Answer Dashboard'), ...
0
votes
0answers
23 views

Dump raw select query with parameters values

I would like to debug select query and I use the next code, for example: $connection = \Drupal::service('database'); $query = $connection->select('node', 'node'); $query->fields('node', ['nid']) ...
0
votes
1answer
141 views

Attempting to merge in an array of items into Twig classes

I have a Twig template where I'd like to merge in an array of items as classes. So far I have this code: {% set classes = [ 'media', 'media--type-' ~ media.bundle()|clean_class, not media....
0
votes
0answers
15 views

Can't generate stack trace for EntityMetadataWrapperException, even with Devel and ddebug_backtrace()

I have the following error on a product display page on Drupal 7 : EntityMetadataWrapperException : Unknown data property field_attribute_name. dans EntityStructureWrapper->getPropertyInfo() (ligne ...
3
votes
1answer
123 views

How to I trigger Xdebug 3.x with Drush in PHPStorm

Has anyone has success with getting CLI debugging (drush) working with Xdebug 3.x? There are several obsolete posts here... but all obsolete with the new version of Xdebug. Expected behavior After ...
0
votes
0answers
34 views

How can I print debug info in custom module?

I need to edit parts of a custom module that I didn't make, and I don't really have much experience editing/coding custom modules. How do I print debug info in functions in a custom module? In the ...
1
vote
0answers
92 views

Drupal + XDebug + VSCode = can't break on PHP notice or warning

Using Drupal (8.9), PHP (7.2.34) with xdebug, and VSCode (1.50.1) with PHP Debug (1.13.0), the debugger will no longer break on PHP notices and warnings, even if those option checkboxes are set. The ...
1
vote
1answer
51 views

Debugging node/route access

I want to set a breakpoint in xdebug to debug an interesting issue the site is having regarding user access to certain nodes. My question is where do I do that in D8? Where, specifically, is the D8 ...
0
votes
1answer
432 views

Debugging Ajax Callback

Goal: Print/dump $formState values to debug I am altering a form and the functionality works: $form['elements']['location']['deparment']['#ajax'] = [ 'callback' => 'myAjaxCallback', 'event' =&...
1
vote
1answer
163 views

twig dump() creates WSOD error

this is my first Drupal installation (I'm a symfony dev) and I've spent several hours trying to get dump() working. However it just causes a WSOD. Maybe related: I'm unable to install kint, there's ...
3
votes
1answer
351 views

Debug PHP code with XDebug and VS Code [closed]

For development I use a local Drupal 7 installation on Xampp under Windows 10. I use Visual Studio Code as IDE and want to debug my PHP code with it. I tried to set that up but can not quite get it ...
0
votes
1answer
116 views

The “Modules” page doesn't load

I am running a setup on Ubuntu and WSL (Windows Subsystem for Linux) with Nginx and PHP7.4. Drupal 8 and Drupal 9 fresh installations load every page with no problem, except the page on /admin/...
0
votes
0answers
104 views

how to print node object in drupal 8 [duplicate]

in drupal 7 we could use kpr() from devel module or php print_r() and var_dump() functions to print $node object in node.tpl file or hook preprocess node in purpose of debugging and finding a field or ...
-3
votes
2answers
475 views

How can I prevent memory size exhaustion when dumping variables in Twig? [duplicate]

hello everyone i have a problem with kint , in my twig page i want to listing all variables contains int 'content' variable to make some logic on it , but the page can't loaded because the big pip ...
4
votes
1answer
379 views

How to attach xdebug to drush in docker

How can I "attach" xdebug to drush in a docker container? By that I mean, how can I have xdebug show me a history of an import script? And to look at the single variables that are defined and ...
1
vote
0answers
268 views

Render HTML in Drupal 8 error messages

I'm working with Twig templates, and often see messages like this in the browser when I make a mistake: The website encountered an unexpected error. Please try again later.</br></br><...
1
vote
0answers
360 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 ...
3
votes
1answer
136 views

Difference between $bundle and bundle()

Background information: I'm trying to manipulate the available options of a list type text field, depending on the host bundle: function wtbase_options_list_alter(array &$options, array $context) ...
1
vote
1answer
81 views

Why can't I debug twig templates with intellij idea?

I can't get intellij idea to break on twig files. It is breaking on theme and module files fine. This means that xdebug must be setup correctly. I don't believe that it is caching as I've deleted the ...
2
votes
0answers
147 views

Does the structure of the module's src folder matter? [closed]

I've read about the Basic Structure guide to building a Drupal 8 module. It's great that it outlines the basic files needed to get a module up and running. Where it falls short is the contents of the ...
0
votes
1answer
92 views

How to debug why some content is not migrated from D7 to D8?

I am using migrate_plus to migrate from D7 to D8 and so far it has been a fairly smooth process. I have a particular content type that has 10 nodes in D7 but will only migrate one of them to D8. ...
0
votes
0answers
77 views

Is there a dd() like variable printer that can be used inside a preprocess?

Many times when I start a hook_preprocess_hook, I start by printing the $vars object. I can do this by dpm()'ing, dsm()'ing, kint()'ing etc. The problem is that all of these functions print $vars in ...
0
votes
1answer
201 views

Extending a base template file such as field.html.twig renders no results?

So I have a custom content entity that has the typical attributes. Name, Author, Creation Date, ect. In the 'view' tab of this content entity, it displays said name, author, ect. When I hover over ...
0
votes
0answers
358 views

Why is my custom twig template not being selected by Drupal?

So I have a custom module that has boilerplate template code inside it. No problem there. So I following the Drupal Docs which says to create a service.yml file and turn debug on and caches off. Done. ...
0
votes
1answer
996 views

How do I debug with Xdebug in Visual Studio Code? [closed]

When I try to debug Drupal 8 (8.6.11) using Xdebug in VS Code (I'm on Win 10 but I doubt it is relevant in this case) I get the following error: Exception has occurred. Dotenv\Exception\...
1
vote
1answer
344 views

How do I debug incorrect favicon showing on the front page in a custom theme?

I'm working on a Drupal 8 site with a custom theme that I didn't code. The site is using the metatag: favicons module to control the favicons. The favicon seem to work correct on all except the home ...
2
votes
1answer
526 views

How to properly attach Google Maps Api to Drupal behaviors in Drupal 7?

So, I've posted on this elsewhere and I seem to either get half answers but they've gotten me closer to a solution but not over the finish line. I'm trying to implement a custom Google Maps ...
0
votes
0answers
181 views

AttributeArray fails to implode #allowed_tags

I started working on existing project and right from beginning, it displayed tons of alerts in specific pages. This is what Drupal outputs: Notice: Array to string conversion in Drupal\Core\Template\...
1
vote
2answers
128 views

Manipulate a render array in hook_node_view

I'm wanting to modify the contents of some fields at display time so looked at hook_node_view(), however, the $build array is not what I'm expecting, if I dump it with var_dump it is thousands of ...
1
vote
0answers
21 views

Left to right mark added to field name

Using Drupal's admin I added to an existing content type a new text field with the machine name field_note. When fetching the field in my code I want to check if $field_name == 'field_note' but it ...
0
votes
0answers
540 views

Unable to determine class for field type during upgrade

I'm getting the following error when I am updating my site's core and contrib modules. I'm at a loss as to how I would go about finding the issue. I've gone to views.views.inc line 181 and looked ...
0
votes
0answers
223 views

Debugging strange memory overflows on Pantheon

We have a Drupal Commerce site on D8.6.7 running on Pantheon Performance Small servers. We do a bit of side processing besides normal e-commerce stuff like syncing up data, collecting emails, etc. ...
0
votes
0answers
1k views

How to turn off Twig debugging for a views feed?

I am trying to build a calendar rss feed from views. The rss.xml is being generated, but it doesn't appear to be accepted as a calendar rss on local systems. When I look at the source, I see it's ...
0
votes
0answers
37 views

How to trace the raw data of each element in a web page we want to check?

I'm a beginner of Drupal8, and I've encountered lots of difficulties till now. One of the biggest one is that when I enable the Theme Debug, I always confused about where the selected part comes from. ...
1
vote
0answers
632 views

Throwing an AccessDeniedHttpException() in an event causes a “max nesting level” error

I am debugging an event subscriber that checks if a user has access based on certain conditions. If they don't have access, then I am doing: throw new AccessDeniedHttpException(); However, this was ...
1
vote
1answer
751 views

Translation: File upload error. Could not move uploaded file

I would like to import an translation file *.po. When I import it, I become the error: "For security reasons, your upload has been renamed to bootstrap-all.de_.po." and "Error message File upload ...
3
votes
1answer
756 views

Settings contains a dot which is not supported, but module gets enabled properly

I'm developing a search engine module for Drupal 8. On a clean new Drupal website, I can install it from the admin GUI, but when I enable it I have the classical white screen (The website ...
1
vote
2answers
220 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
1answer
1k views

Debugging Module Show PHP Errors

I saw in a YouTube video someone had made a configuration where if there was a PHP bug in their module, upon cache rebuild it would show the error underneath the "The Website Encountered an Unexpected ...
0
votes
1answer
62 views

Language switcher block hides for authenticated user

I have a language switcher added to my site. It works fine as long as I'm an unauthenticated user. Logging into site replaces it with: <span data-big-pipe-placeholder-id="callback=Drupal%5Cblock%...
0
votes
0answers
127 views

Error message not converting html tags

In entity browser I tried uploading a file which is not supported. So I got the valid error message. But it does not convert the html tags which are being generated from token. Following is the code ...
1
vote
1answer
28 views

Is there a way to supress particular messages or a class of messages on the screen?

Is there a way of suppressing a particular class of messages from being displayed on the screen, such as the one displayed below? Deprecated function: Methods with the same name as their class ...
0
votes
0answers
109 views

Can't access the Status Report page

I've updated my LOCAL site with composer, updated the database but can't access the Status Report page (site encountered an unexpected error). I looked at the recent log messages and saw this error: ...
1
vote
1answer
1k views

500 error without any error log entry

Migrated a Drupal 8 site to another server running apache2 PHP 5.5.9 (should be supported). Apache returns 500 when index.php requested, but no errors are logged anywhere. I tested by forcing an ...
0
votes
2answers
92 views

Receiving Error message on every attempt to add or remove content. Is this normal?

New to drupal & collaborating on a project. Error message reads "Error ; The website encountered an unexpected error. Please try again later." I've been getting that error message for 4 days in a ...
-1
votes
1answer
1k views

showing errors even though display_errors is off

I want to hide all error messages to the users. I did all the three steps below Set display_errors = off and error_reporting = 32767 in php.ini Made sure this config $config['system.logging']['...

1
2 3 4 5
11