drupal-modules

Fatal error: Call to undefined function lock_acquire()

人盡茶涼 提交于 2019-12-08 08:23:13
问题 I'm using Drupal Version 6.25. I duplicated an existing drupal page and tried to install it locally on my system. After the Step where I entered the database information I got this fatal error: Fatal error: Call to undefined function lock_acquire() it seems to be located in: modules/system/system.module on line 810 but unfortunately I couldn't figure out how to fix it. Hopefully somebody of you know how to fix it because I can't go any further and I need this duplication locally. 回答1: At the

Change form data after submit in drupal

梦想与她 提交于 2019-12-08 04:07:24
问题 in some content type form I added a checkbox. When this checkbox is checked I want to remove some of the submitted data. To do so I created a custom module (my_module.module): function my_module_form_alter(&$form, &$form_state) { // ... $form['#submit'][] = 'my_module_form_alter_submit'; } function my_module_form_alter_submit($form_id, $form_values) { drupal_set_message(t('Submit Function Executed!')); } How can I tell this module to refer only to the form of a certain containt type? And how

Drupal 7 FAPI- Adding form elements in validate or submit handlers

懵懂的女人 提交于 2019-12-07 17:33:35
问题 Is it possible to add additional form elements in the validate or submit functions in drupal 7 module? The following code works and image is displayed on the form: function test1_form($form, &$form_state) { $form['image']=array( '#markup'=>'<img src="sites/all/modules/create_ad/th.jpeg"><br/>', //replace with your own image path ); $form['submit'] = array( '#type' => 'submit', '#value' => 'Submit', ); } but when I try to display image after submission in submit function like following, it

hook_user(): inserting extra field into database not just form

十年热恋 提交于 2019-12-07 15:31:11
问题 I can add an extra field to the registration. What I need to know is what step do I need to take to then grab that input and insert it into the user table of drupal. The code below is in my module this adds just a field to the form, but when its submitted it doesnt do anything with the data. function perscriptions_user($op, &$edit, &$account, $category = NULL){ if ($op == 'register') { $form['surgery_address'] = array ( '#type' => 'textarea', '#title' => t('Surgery Address'), '#required' =>

how to override Drupal path from another module

独自空忆成欢 提交于 2019-12-07 14:46:04
问题 I want my module to override the path was set by another module Example: Module A has register a path: $menu['node/%id/test'] = array( 'title' => 'Test', 'page callback' => 'test_A', 'page arguments' => array(1), 'access callback' => 'test_access', 'access arguments' => array(1), 'type' => MENU_LOCAL_TASK, ) Now I create module B and register the same path. $menu['node/%id/test'] = array( 'title' => 'Test', 'page callback' => 'test_B', 'page arguments' => array(1), 'access callback' => 'test

drupal field widget not saving submitted data

流过昼夜 提交于 2019-12-07 03:26:47
问题 I'm trying to create a custom widget but when I submit, Drupal doesn't seem to save any data. When using hook_field_attach_submit() to display what data I've pasted, it is listed as null. Strangely, if i change the #type to be a single textfield instead of a fieldset it will save only the first character of the string that has been entered. This seems like a validation issue, but I'm not sure how to hook into it or to debug the problem. Where can I go from here? <?php function guide_field

How to allow multiple blocks in a module of Drupal

梦想的初衷 提交于 2019-12-06 16:23:22
问题 I am trying to make a module for Drupal 7 that provides a block and has certain configuration settings. Now what I want is that I want to provide 5 blocks to the user so that they can use different settings in each block. In other words, I want to provide each block a separate set of settings. How can I do that? Edit: Actually I have made a module that shows a single block. If you have used superfish menu module then you can see there that they allow us an option to choose how many block

How can I redirect a Drupal user after they create new content

*爱你&永不变心* 提交于 2019-12-06 16:00:02
问题 I want to redirect my users after they create a piece of new content, instead of directing them to the 'view' page for the content. I have seen mention of using hook_alter or something, but I'm really new to drupal and not even sure what that means? Thanks! 回答1: As you mention that you are new to Drupal, I'd suggest to take a look at the Rules module. You can add a trigger on for content has been saved/updated and add an action, to redirect the user to a specific page. You can however do the

Drupal 6 module install file not creating tables in database

落花浮王杯 提交于 2019-12-06 04:11:34
问题 I'm using the Schema API to create tables for my module on Drupa 6.17, but the tables just do not get created in the database. I have the Schema module installed, and it tells me that while the schema for my module is recognized, its table is not in the database. It comes up under Missing: Tables in the schema that are not present in the database. test * test_table Here are the contents for my test.install file. <?php // $Id$ function test_schema() { $schema['test_table'] = array(

ckeditor strips <span> and style attributes

血红的双手。 提交于 2019-12-06 02:57:59
问题 I have a Drupal 7 site using ckeditor 4.2. I've created a basic page node and put a span inside an h2 heading in the body. I hard coded it in the html view. It looks fine but if I go back to edit the page, my has gotten stipped out of the html and also any style="" I've put into the html also. I've looked at the ckeditor config and text-formats. I've set the only formats allowed to be text and full html so I'm not using filtered at all. What gives? I've used the editor many times before but