Drupal Questions & Answers

How can I change the Apache Solr search URL in Drupal?

asked Mar 02 2011 20:49 on drupal

How can I change the default Apache Solr URL path from "search/apachesolr_search/term" to something else?

Answers (8)

How can I change a user's Drupal password?

asked Mar 02 2011 20:50 on drupal

How can I change a user's Drupal password from the command line with Drush?

Answers (7)

What's the proper use of EntityFieldQuery?

asked Mar 02 2011 20:51 on drupal

In Drupal 7, the API documentation for node_load_multiple() specifies using the $conditions parameter has been deprecated in favor of using EntityFieldQuery. How does one use the class to generate a list of node IDs for use with node_load_multiple()? Are there any other use cases for it?

Answers (4)

Basically, one of the greatest questions of all time: What are some ways you're using settings.php in your development/staging workflow?

Right now, I have my settings.php file set up like the following, and I base my development on the server's $HOST directive—meaning I can work on dev.example.com for the development (shared) server, local.example.com for my local computer (and other dev's local code checkouts), and www.example.com (or just example.com) for the live site.

(This code is in the 'Database settings' section of settings.php):

$host = $_SERVER['HTTP_HOST'];
$base_url = 'http://'.$host;
$cookie_domain = $host;

switch($host) {
  case 'example.com': # Production server
    $db_url = 'mysqli://prod_sql_user:[email protected]/prod_db';
    $update_free_access = FALSE;
    $conf = array (
      // Set production config options here...
      'example_setting' => 0,
    );
    break;

  case 'dev.example.com': # Development server
    $db_url = 'mysqli://dev_sql_user:[email protected]/dev_db';
    $update_free_access = FALSE;
    $conf = array (
      // Set production config options here...
      'example_setting' => 0,
    );
    break;

  case 'local.example.com': # Local server
    $db_url = 'mysqli://local_sql_user:[email protected]/local_db';
    $update_free_access = FALSE;
    $conf = array (
      // Set production config options here...
      'example_setting' => 0,
      // Turn off most core caching.
      'cache_inc' => 'includes/cache.inc',
      'cache' => CACHE_DISABLED,
    );
    break;

}
?>

This works pretty well for most purposes, but it means we have a lot of extraneous code sitting around in our shared settings.php file... is there a better way?

Answers (7)

What are some of the biggest differences between Drush versions 3.x & 4.x?

Answers (2)

How to take a Drupal site offline using Drush?

asked Mar 02 2011 20:57 on drupal

How can I take a Drupal site offline using Drush?

Answers (5)

Do non-enabled modules affect performance?

asked Mar 02 2011 20:59 on drupal

Does having Drupal modules present, but not enabled have any effect on the performance of a Drupal site?

To put it another way.. Would removing disabled modules from a Drupal site have a positive affect on performance?

Answers (9)

I'm building a plugin using the WYSIWYG API module for Drupal 7 that will add a button to the toolbar of supported editors.

I'm using the hook_wysiwyg_plugin() hook to create a new button on editor toolbar but I need to load a few other javascript files. The hook_wysiwyg_plugin() hook seems to allow you to specify one JS and CSS file.

How can I load extra required javascript files required for the plugin javascript?

I've implemented hook_library() to define a library i.e. js/css files but am unsure how I hook that up to wysiwyg api so that they load on the node/edit screens?

Answers (3)

How can I determine from within a module or theme if the current Drupal page is an Apache solr search results page?

Answers (5)

How to maintain a local mirror on my Mac?

asked Mar 02 2011 21:02 on drupal

I have a personal Drupal 6 site being hosted commercially, and I would like to maintain a mirror of the site on my local MacBook for the purposes of developing custom modules and themes before deploying them. My question has two parts:

  1. How do I set up my Mac so that it's ready to install Drupal?
  2. How do I mirror my live site locally?

Answers (4)

We got multiple small websites (microsites) and one main high traffic one with big users base. Right now the requirement is to build authentication system which should allow users to loign with the same identity across the network.

All website are running on different domains, powered by Drupal 6 CMS and have separate databases (so sharing tables with prefix is not an option + it creates a huge mess in the db).

Here is the set of core requirements I came up with:

  1. Users should be able to login with the same credentials to all sites within the network
  2. User’s data sharing between Main site (storage) and all micro sites within the network
  3. Data synchronization across the network when user changes the data (update email or password for example)
  4. The login/registration process should be seamless and consistent
  5. Register on any of the sites across the network and use that identity to login later on.

In the future there might be a need to add openid authentication options.

Basically we are looking at something similar stackexchange does, but not sure if they have central users base on not.

I was thinking about custom solution which will include 2 parts (modules), one will be stored on the Main site for users data storing and responding to requests from clients. Second part (module) will be placed on each microsite, which is going to send requests to the Master. Some kind of client - server setup.

One of the complications I see right away is #3. Data Synhcronization across the network.

I just don't want to reinvent the wheel and maybe some work is already done in this direction.

Looking forward to your ideas on how to approach this project.

EDIT:

Recently I've found couple related threads on the topic:

http://groups.drupal.org/node/24916
http://drupal.org/node/744400

Answers (4)

I have used the Microsoft Web Platform Installer to install both Drupal 6 and Drupal 7 on my Windows Server 2008 R2 servers running IIS 7.5. (see: http://www.microsoft.com/web/downloads/platform.aspx)

I'd like to know what file and folder permissions WebPI is modifying (and why) and the web.config additions it is making so that I can manually install Drupal under IIS for those times when the default installation parameters need to be tweeked (such as where the databases are housed).

Changes made to PHP to make it play nice with Windows + IIS would also be helpful.

Answers (3)

How do I backup my site w/o the command line?

asked Mar 02 2011 21:05 on drupal

Nearly all the documentation on backing up my Drupal site seems to require using the command line. My hosting service does not provide command line access. How do I backup my site without using the command line?

Answers (4)

Rebuild imagecache

asked Mar 02 2011 21:05 on drupal

I have an imagefield per node that's run through imagecache. Since imagecache caches on-demand, cache files/variations aren't created until they're first requested. So if I update a bunch of images, re-deploy, or otherwise blow the whole cache, it's up to first visitor to process that file.

How can I spare that user the load time and manually rebuild the whole cache?

The last time this came up, I programmatically loaded every node link with jquery ...

Seems like a perfect Drush plugin ... should probably look into writing it, but I'm curious if anyone else has a solution for this.

Answers (6)

Authentication for iCal feeds

asked Mar 02 2011 21:06 on drupal

I have a calendar feed (using the Drupal Calendar module) on a site and I'd like to add this calendar to Google Calendar. I have this working for a publicly accessible calendar and it works fine.

The problem now is that my calendar is only accessible for authenticated users and should remain so. I see no way to authenticate the application accessing a feed and therefore can't access that calendar from Google Calendar.

Is there any way to provide credentials in the feed url or something similar?

Answers (1)

Redirect on Login?

asked Mar 02 2011 21:09 on drupal

I have tried making this a rule as well as used hook_user with no luck. It definitely gets inside of the login case (had a watchdog log), but the redirect doesn't happen and they are still sent to /user upon logging in.

I am trying this with no luck:

/**
 * Implementation of hook_user()
 */

function multistep_registration_user($op, &$edit, &$account, $category = NULL) {
    switch ($op) {
        case 'insert':
            multistep_registration_save_content_profile_name($account);
            break;
        case 'login':
            if (!multistep_registration_is_complete($account->uid)) {
                drupal_goto('user/register/complete-registration');
                exit;
            }
            break;
        default:
            break;
    }
}


function multistep_registration_is_complete($uid) {     
    if ($uid == 1) {
        return TRUE;
    }

    $node = content_profile_load('profile', $uid);

    if ($node->field_completed_registration[0]['value'] == 'yes') {
        return TRUE;    
    }

    return FALSE;
}

Why is it not redirecting? New users all have the value set as 'no'.

Answers (4)

I'd like to migrate a client's site from Drupal 6 and Ubercart to Drupal 7 and Drupal Commerce. Is there an easy (i.e.: no manually munging data in the database) migration path? Do I need to go to Drupal 7 + Ubercart as an interim step?

Answers (4)

Are there any specific requirements for module development and in site architecture for running "heavy" drupal site in several ec2 instances with load balancers?

Answers (1)

Views 2 Conditional Filter

asked Mar 02 2011 21:10 on drupal

How can I apply a conditional fitler to a view (using views 2)?

For example: I have a view which displays the teasers for several different node types using a filter on Node:Type in [Blog entry, Forum topic, User profile]

This works well for showing all nodes of those types, but suppose I only want to show a user's profile if it has a picture as well (and all of the other types).

Answers (4)

I've been using MP3 Player to provide an on-page mp3 player, but I also need to be able to handle midi files. Right now the best I can do is allow them to be uploaded into the "mp3 file" field, but when it renders the node, it just gives a link to the file, which mean you have to navigate to the file (or open it in a new tab) for the browser to play it.

Answers (3)