drupal-7

Very strange Drupal 7 404 behaviour

一世执手 提交于 2019-12-22 08:54:57
问题 I am having some very strange behaviour in D7 that I have not seen before. I have migrated a new site from my dev machine to a test machine, so code and DB are identical. On the dev machine (Ubuntu 13.04, Apache, PHP 5.5.3), everything works fine, but on the test box which is a Raspberry Pi running PHP 5.4.4 on Raspbian, I seem to get 404 errors on form submission. What seems to happen is that the form is not processed and the original page is returned but with a 404 status code when you look

Change admin password in drupal 7

社会主义新天地 提交于 2019-12-22 08:25:43
问题 I am using built in Drupal 7 user module, fore user registration, forgot-your-password-emails and all that stuff. I have forgotten my admin password. I have access to my website which is hosted on 1and1.com and also have access to mysql? Is it possible to change password or email address through SQL so that I can access the admin page? If it possible how? Can you somebody help me with this? Thanks! 回答1: If you have Drush installed, you just have to enter the following command in the terminal

Add CCK field to custom form in Drupal 7

喜夏-厌秋 提交于 2019-12-22 07:02:58
问题 There was a method with CCK in Drupal 6 to attach a CCK field in our custom form, like: $field = content_fields('field_name'); // field_name is cck field (text_field,text_Area,image_field anything.) $form['#field_info'][$name] = $field; $form += content_field_form($form, $form_state, $field); How can I achieve the same functionality in Drupal 7? I had a form and I want to use the field that I created for a content type. I went through all the files of field.module but couldn't find anything.

Add CCK field to custom form in Drupal 7

為{幸葍}努か 提交于 2019-12-22 07:02:14
问题 There was a method with CCK in Drupal 6 to attach a CCK field in our custom form, like: $field = content_fields('field_name'); // field_name is cck field (text_field,text_Area,image_field anything.) $form['#field_info'][$name] = $field; $form += content_field_form($form, $form_state, $field); How can I achieve the same functionality in Drupal 7? I had a form and I want to use the field that I created for a content type. I went through all the files of field.module but couldn't find anything.

ob_flush takes long time to be executed

▼魔方 西西 提交于 2019-12-22 03:44:10
问题 In my website(running with drupal) the ob_flush function takes a long time(between 10 - 100 secs) to be executed. How do I find out why? What can cause this so long time? 回答1: Try this: ob_start(); //Your code to generate the output $result = ob_get_contents(); //save the contents of output buffer to a string ob_end_clean(); echo $result; It is run quick for me. 回答2: [You may want to tag your question with Drupal, since this feels like it might be a Drupal issue. Specifically, I suspect that

Render a Drupal node

元气小坏坏 提交于 2019-12-22 02:34:07
问题 I would like to show a node inside another node. So I retrieve the node id of the second node and I would like to render/print/... it inside another node. But I'm not sure how to do this. I've tried drupal_render , node_view , print ,... but with no results. Any advice? $nid = $node->field_linked_fiche['und'][0]['nid']; $fullFiche = node_load($nid); EDIT - the whole template <?php /** * @file * Bartik's theme implementation to display a single Drupal page. * ... */ ?> <div id="page-wrapper">

Theme a custom menu with theme_menu_tree()

∥☆過路亽.° 提交于 2019-12-21 21:21:26
问题 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. 回答1: I had the same problem with overriding and correct naming of

PHP arrays… What is/are the meaning(s) of an empty bracket?

喜你入骨 提交于 2019-12-21 19:24:43
问题 I ran across some example code that looks like this: $form['#submit'][] = 'annotate_admin_settings_submit'; Why is there a bracket after ['#submit'] that is empty with nothing inside? What does this imply? Can anyone give me an example? Normally (from my understanding which is probably wrong) is that arrays have keys and in this case the the $form array key '#submit' is equal to 'annotate_admin_settings_submit' but what is the deal with the second set of brackets. I've seen examples where an

Safari 5.1 breaks CSS table cell spacing

筅森魡賤 提交于 2019-12-21 17:09:20
问题 My site was working fine across all major browsers right up until the update to Safari 5.1. Now, the primary navigation is busted up. I was using display:table-cell on the anchor element within the list element and was also using the font-size:0 hack to remove the spacing in between menu elements. Has anyone else encountered this issue and have a solution they could offer up? Before: After: CSS: #navigation { padding-top: 7px; } #navigation ul.links, /* Main menu and secondary menu links */

Datetime type in Drupal 7 schema

老子叫甜甜 提交于 2019-12-21 17:02:23
问题 I'm writing a new Drupal 7 module (Drupal 7.10, Date 7.x-2.0-rc1 installed, Schema 7.x-1.0-beta3 installed) i defined a table in mymodule.install: $schema['museums_tickets']= array( 'fields' => array( 'nid' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, ), 'day' => array( 'type' => 'datetime', 'mysql_type' => 'DATETIME', 'not null' => TRUE, ), 'tickets' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, ), 'ticket_code' => array( 'type' => 'varchar',