drupal-7

Moved Drupal 7 site to a different server, can't log in

守給你的承諾、 提交于 2019-12-04 17:09:40
问题 I recently moved my Drupal 7 site to a new hosting server and I'm stuck at the login page. As soon as I try and log in, I get directed back to the same page, but the URL changes from /user to /user/1 , which leads me to believe that I am actually logged in, but I'm not being forwarded to the correct page. I tried cleaning my cache, emptying the cache tables in the DB but nothing helped. Any ideas? EDIT: To make things a bit more clear, I've used the specific server for various other Drupal 7

Theme a custom menu with theme_menu_tree()

妖精的绣舞 提交于 2019-12-04 15:48:40
I'm trying to override a custom menu output in a block so that instead of <ul class="menu">...</ul> I can get <select name="menu title">...</select> In Drupal 6, I could use function theme_menu_tree($tree,$menu_name="") {...} but this doesn't work in Drupal 7 with function theme_menu_tree($variables) {...} . I've tried theme_menu_tree__mymenu($variables) {...} with no success. How do I specify a unique menu in Drupal 7? Thanks. I had the same problem with overriding and correct naming of the theme_menu_tree function for a specific menu name. What I found I suppose that the correct name of your

How to remove /drupal from URL in Drupal 7 when installation is in the associated sub-directory

≡放荡痞女 提交于 2019-12-04 14:44:20
问题 In Drupal 6 I was able to successful install Drupal in a subdirectory called drupal and then reference the site without having to use example.com/drupal. In Drupal 6 to get this to work I did the following: - Created an .htaccess file in the root directory where /drupal was created. The file contents was: Options -Indexes RewriteEngine On RewriteRule ^$ drupal/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ drupal/$1 Updated the drupal/sites/default

Drupal 7: How to alter image field widget “alt” or title\" label

孤街浪徒 提交于 2019-12-04 14:36:23
I am trying to change the "alt" and title" labels in the Image Widget on the node add form. I have tried both of these hooks: hook_field_widget_form_alter hook_form_alter I was unable to find where I needed to go to successfully alter the label. Could some one please direct me to the appropriate way to hook into this and alter them? I'm hitting these from a custom module if it makes a difference. Hitting them via the theme would be fine for me as well. Any ideas anyone? TheodorosPloumis You have to add an extra Proccess function for the widget form. You can also use dpm($element) with Devel

Add Table Join, Where, and Order By to Views Query in views_query_alter()

血红的双手。 提交于 2019-12-04 13:34:26
问题 I am trying to modify the query for Views in Drupal (Views version 3, Drupal version 7). What I want to do is change the query prior to running such that it LEFT JOINs a table in which I have weights assigned to the nodes. If I was to write the query I want in SQL, it would look like this: SELECT a.nid, a.title, a.description FROM node a LEFT OUTER JOIN node_weights b ON a.nid = b.nid WHERE b.uid = $uid ORDER BY b.weight DESC This query works like a champ when I run it in the query analyzer.

Custom Drupal 7 Field only saves the first character

江枫思渺然 提交于 2019-12-04 12:48:00
I'm essentially trying to create my first field type module using the new Drupal 7 Field API. I've managed to get it to display correctly in the "edit" view. However, when I try to save some data it only saves the first character. Here's the module: <?php function youtubefield_field_info() { return array( 'youtubefield_video' => array( 'label' => t('Youtube video'), 'description' => t('This field stores a youtube video ID and displays the video associated with it'), 'settings' => array( 'max_length' => 11, ), 'instance_settings' => array( 'text_processing' => false, ), 'default_widget' =>

how to construct an https POST request with drupal_http_request?

回眸只為那壹抹淺笑 提交于 2019-12-04 12:44:20
I want to send a POST request to an https server. $data = 'name=value&name1=value1'; $options = array( 'method' => 'POST', 'data' => $data, 'timeout' => 15, 'headers' => array('Content-Type' => 'application/x-www-form-urlencoded'), ); $result = drupal_http_request('http://somewhere.com', $options); I can't figure out out to implement the https options in the POST example code above. Can anyone please explain me how to do this? I am quite new to PHP coding with Drupal, and I could definitely use the guidance. I found that all is needed is to set it in the protocol. So I got to this code. $data

Is it possible to get the eBay Category List via an API programmatically?

杀马特。学长 韩版系。学妹 提交于 2019-12-04 12:06:21
My goal is to get a list of eBay categories programmatically. It appears that the GetCategories method is only available from the Trading API. If I understand correctly, there is user interaction required to log into the Trading API: http://developer.ebay.com/DevZone/XML/docs/HowTo/Tokens/GettingTokens.html Is there another method to get the eBay categories list programmatically? I'm using Drupal 7, so PHP. You do not need a token to get the categories. All you need is your App-ID The link below with your APP-ID will return the XML category listing from site: UK (siteid=3) Setting CategoryID=

Facebook Chat Bot - How do I test the welcome message?

女生的网名这么多〃 提交于 2019-12-04 11:57:48
问题 My chat bot is working great but I am having trouble debugging the Welcome message functionality because it only shows up when a conversation is initiated (although i'm pretty sure it's not working having tried it on a colleagues phone). How do I reset my chat so it sees me as a new user interacting with it? This is my welcome PHP Script at the moment <?php function webhook() { $challenge = $_REQUEST['hub_challenge']; $verify_token = $_REQUEST['hub_verify_token']; if ($verify_token ===

Drupal 7: Pathauto hierarchical taxonomy terms pattern

我怕爱的太早我们不能终老 提交于 2019-12-04 11:30:34
I have a Drupal 7.9 taxonomy vocabulary according to the following scheme: category-1 category-1 > subcategory-1-1 category-1 > subcategory-1-2 category-1 > subcategory-1-3 category-2 category-2 > subcategory-2-1 I want to reflect this taxonomy hierarchy in my page url path like category-1/subcategory-1-1/page-123 To achieve this I'm using the modul Pathauto version 7.x-1.0. but I don't know which pattern I have to use. Currently I'm using [node:%field_taxonomy%]/[node:title] but with this pattern the url path is just subcategory-1-1/page-123 , so the complete hierarchy isn't reflected. Is