Drupal Duh

Drupal is a complex and powerful system, so sometimes we miss the obvious while looking for something more complicated.

Aug 20

#8

Problem: l() not outputting anything.

Complex Solution: Oh, query needs to go in options, not in the path! Nope, still doesn’t work. Oh, that leading slash shouldn’t be there! Nope, still doesn’t work. Hmm…

Actual Solution: There’s no “print” before the l() telling it to print.


Aug 11

#7

Problem: dpm() not outputting

Complex solution: Maybe it’s a permissions problem. Or caching might be it. Or your templates are missing $messages. Wait, that’s weird, exit() doesn’t end the request either.

Actual solution: You are putting your code in the wrong function, which is never being called.

submitted by beeradb


Jul 25

#6

Problem: your implementation of hook_node_access_records() and hook_node_grants() isn’t working, returning FALSE for node_access() when it should return TRUE.

Complex solution: confirm that node_access_grants() returns the expected grants. Confirm that the grants give access in the node_access table. Reexamine your understanding of how grants work.

Actual solution: notice the nodes are unpublished, which makes the grants irrelevant.


Feb 17

#5

Problem: despite carefully following the directions on Drupal.org for theming search results, the search results are not changing.

Complex solution: double-check for a typo in the function name by copying and pasting every part of it. Clear the cache when that doesn’t work.

Actual solution: note the “Drupal 5.x” tag on that page, and realize you’re running Drupal 6, where this markup is created by templates in modules/search.


Feb 11

#4

Problem: you can’t find the CSV export option for Views.

Complex solution: maybe CSV only works for node views? Maybe it’s a subset of configuration for some other type of display?

Actual solution: select feed as the display type.

(from beeradb)


Jan 27

#3

Problem: template changes are showing up in one browser, but not another.

Complex Solution: it can’t be server-side caching, so must be something in the browser. Clear the cache in every imaginable way to get the non-updated browser to update.

Actual Solution: you’re logged in in the updated browser and not the other. (That’s why you’re using two browsers, of course.) It actually is cached on the server. Clear the cache.


Jan 26

#2

Problem: changes to views aren’t showing up on the site.

Complex Solution: caching somewhere? Changed the wrong display?

Actual Solution: you didn’t save changes to the view.


Jan 20

#1

Problem: your dsm() message isn’t firing.

Complex Solution: the code must not be reaching that line for some reason.

Actual Solution: you’re not logged in as admin and dsm() only shows to admin by default.