views:

124

answers:

4

Hi guys, I'm starting to switch from ASP.NET to PHP, and also Drupal.

In ASP.NET, if the user has Cookies or Javascript turned off, this can introduce a lot of unforseen problems and complications. Most users have the default settings (on,on) but when they don't, mud hits the fans and it can be confusing as to where the "bug" is.

What other kinds of gotcha's are there for PHP and Drupal? Will there be problems if Javascript, Cookies are turned off? Other things to look out for?

+2  A: 

As with many login systems, users cannot log into Drupal with cookies disabled. See this thread for a bit more info: http://drupal.org/node/137678

Drupal should work fine with JS disabled, however.

I can't think of any other gotchas.

Mike Crittenden
+1  A: 

There are soo many! :P

Anyway, PHP doesn't rely on Javascript so you're safe there.

Regarding cookies, they are needed to store the SESSION ID but if they aren't active the SESSION ID can be propagated through the URL (I think ASP.NET does this too - inside ()).

I would start reading these high voted PHP questions, from the top to the bottom.

Alix Axel
+2  A: 

If you encounter the "White Screen of Death", go here http://drupal.org/node/158043 for help. There are a few lines of code to add to your index.php file to turn on error reporting (often revealing a fatal error).

Make sure your PHP memory limits are set high enough to run Drupal and any modules you install.

anyaelena
Good point, the WSOD is something that gets everybody at one point or another.
Mike Crittenden
The Apache logs can be a good source to find the problem for WSOD.
googletorp
+1  A: 
  • Don't delete the user with id 0, that is the anonymous user. It'll give you a lot of strange bugs all over the place.
  • Drupal will cache pages for anonymous users. This can sometimes give a few problems if you want to run some code when users visit a certain page etc, as they will just get a cached version and you function wont run. This is, however, a huge performance gain.
  • Drupal does OOP using "hooks", so naming your functions correctly can make the difference between failure and success.
  • Drupal caches a lot of info for the menus and the theming system. If you start to get frustrated because, your style or markup changes don't come into effect, try to clear the cache.
  • Get familiar with drush it will save you a lot of time, when working on a site.

I'm sure there are many more, but this is some of the top ones I've run into over the time.

googletorp
You could refine your first point to "Don't delete anything unless you know what your doing". And you could apply that to everything.
Rimian
@Rimian I have several times helped debug a problem where this turned out to be the source. But I haven't seen any other strange bugs caused by deleting anything else.
googletorp