0

I have an issue with dpm() in that it never seems to return data (and before anyone asks:

  • Yes devel is installed
  • Yes I am logged in as admin
  • Yes print $messages is set
  • Yes the permissions are correctly set
  • No the data set is not empty ( dpm($node) and dpm($content) return an empty field)
  • Yes it did work previously / on ocassion

it does return a message field, but it is just empty).

Is there any other way to view dpm() data, like using Drush or something? I know I should really 'fix the dpm issue' but I have asked around and there does not seem to be an answer.

  • Maybe your data is empty - try dpm('foo bar');...does that still produce a blank message? – Clive Jan 15 '14 at 16:59
  • The data is not empty. dpm($node) and dpm($content) both return an empty field. – kaipee Jan 16 '14 at 11:51
  • Very strange. And this is on every Drupal site on the same machine? Or just this one site? – Clive Jan 16 '14 at 11:53
  • I only have on Drupal site on a VPS. Looks like it was resolved somewhere between fixing drush and a file descriptor limit issue – kaipee Jan 16 '14 at 12:32
1

I know you say you are logged in as admin but even so just check the permission "Access developer information" is checked for the admin role just in case that makes a difference.

I've also heard of dpm not working as a result of modules not being uninstalled before they are deleted. Maybe try this module to see if that helps.

Another option would be to see if kpr() works instead.

  • Yes the permissions are set - can we move past the quick-n-easy checks? drush clean-modules returns 'nothing to disable' kpr() seems to work (using normal krumo reporting section) – kaipee Jan 16 '14 at 12:24
  • Yes, I did also make some other suggestions. – Felix Eve Jan 16 '14 at 12:25
  • I'm not too sure what did it, but both kpr() and dpm() are now working. I did, however, have some issues with drush executing (and fork: Resource temporarily unavailable errors with SSH) that I had to fix. Perhaps it was something between the drush issue and the file descriptor limit issue that fixed it – kaipee Jan 16 '14 at 12:30
  • Glad you got it working. – Felix Eve Jan 16 '14 at 16:53
0

To answer the question "Is there any way to view dpm() data other than printing it on page?": I've found Object log useful for times when I can't get a dpm() printout (for example, when testing web services).

The Object Log module allows developers to store objects, arrays and other variables to a log table so that they may be inspected later. Multiple stored variables may be displayed side-by-side in the Object log under admin/reports.

The usage is similar to Devel module's dpm() or kprint_r() functions, but is particularly suited for debugging server-to-server requests, such as cron runs and web services, or for requests from anonymous and other unprivileged users.

0

It is possible to display the output of dpm() and other debug helpers like kint from drush also. Just make sure to add --debug to your drush command.

So instead of drush migrate-import mymigration

, use drush migrate-import mymigration--debug

Your debug code does of course need to be run during the drush command, so make sure you pick a command that uses you code. I used this to work with the migrate_spreadsheet module, so running a migration was enough for me to get my feedback.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.