drupal-7

TypeError: i.match is not a function

笑着哭i 提交于 2019-12-05 20:08:00
I have been working on a drupal angularjs module. I have installed bootstrap ui, which is working fine. But when I use modal box it does not work. The code inside the controller: $scope.alertOnEventClick = function( event, allDay, jsEvent, view ){ $scope.alertMessage = (event.title + ' was clicked '); console.log($modal); var modalInstance = $modal.open({ //templateUrl: Drupal.settings.angularjsApp.basePath + '/ng_node/calender/popup', template: "<div class='modal-header'><h3 class='modal-title'>I'm a modal!</h3>" + "</div><div class='modal-body'><ul><li>jfksdfhjksd</li><li>jfksdfhjksd</li><li

Drupal 7 | update multiple rows using db_update

爱⌒轻易说出口 提交于 2019-12-05 15:09:48
I have an array like Array ( [1] => 85590762,22412382,97998072 [3] => 22412382 ) Where key is the item_id and value is the value of a column which I need to update against an item. I can use db_update in a loop but i want to avoid this strategy due to performance. I want to update all the rows in a single db call. Also using db_query I think will not be a good idea. So is there any way using db_update to update these rows? According to above data, standard mysql queries will be like update items set sold= 1, users = '85590762,22412382,97998072' Where item_id = 1; update items set sold = 1,

How to change footer Powered by Drupal and its link?

最后都变了- 提交于 2019-12-05 13:47:05
问题 I am working on Drupal. I want to know how to change that footer text Powered by Drupal and link given to it. I want there "Copyrights 2012 (My site name).All Rights reserved." I can not getting it can any one help me. 回答1: Just go to Structure -> blocks -> Add block Leave block title blank block description Custom Footer or any other if you want and in Block body add following code Copyrights © <a href="http://localhost/drupal-7.12/">TopTableToastMaster</a>.All right reserved. After doing

Drupal 7 override jquery js file in custom theme

谁都会走 提交于 2019-12-05 13:09:57
Is it possible to rewrite/override a default Drupal 7.26 jquery used in custom template scripts variable ? I mean one of the js files: <script type="text/javascript" src="http://drupal.dev/misc/jquery.js?v=1.4.4"></script> by one which comes by custom theme ? I tried this in sites/all/MYTPL/template.php but it doesn't work: $scripts['misc/jquery.js']['data'] = $base_theme . '/js/packages/jquery-2.1.0.min.js'; I would like to know if someone managed it without using any modules such as jQuery Update ? === UPDATED === Actually I solved it by help of accepted answer with some modifications based

Very strange Drupal 7 404 behaviour

核能气质少年 提交于 2019-12-05 12:53:09
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 at the HTTP response. This is affecting everything that uses POST, including login. I did manage to

How and where to write Webform submit hook?

依然范特西╮ 提交于 2019-12-05 11:50:28
I am new to Drupal(7) and hence need some help for following situations. I have created one Webform(I have other webform too) and now instead of inserting in default webform_submitted_data table, I want for this webfrom to insert into myTable. From what I found, I need to write a hook for this. Actually I am getting confused for way to write this hook. I have below questions. Where to write this hook (in which file). How to write this hook only for one webform. Please help and let me know if you need any more information for this. First, be very sure before you start twisting Drupal's arm into

Add CCK field to custom form in Drupal 7

℡╲_俬逩灬. 提交于 2019-12-05 11:31:13
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. There are functions in it like _attach_field , field_info_Field and field_info_instance , but they can

drupal field widget not saving submitted data

落花浮王杯 提交于 2019-12-05 05:54:34
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_widget_info(){ dpm("guide_field_widget_info"); return array( 'guide_text_textfield' => array( 'label' => t

Drupal 6 To 7 Migration

你离开我真会死。 提交于 2019-12-05 02:30:44
问题 We have a drupal site written in drupal 6. We know we will have to rewrite it for drupal 7 (mostly) But the big part is migrating the data. CCK migrate was only able to migrate about 90% of the fields. I am looking for a clean way to migrate the drupal 6 data to drupal 7. We used content_multigroup as a module which is basically like a field collection...How would that be migrated? I am looking for some general strategies...I am thinking of bootstrapping drupal 7 and just write queries

Adding HTML to Drupal closure?

让人想犯罪 __ 提交于 2019-12-05 02:01:37
问题 To add javascript, you can use: drupal_add_js And similar for css: drupal_add_css But what if I just want to add html at the end of my page. I.e. Add a div with some text in it at the end of the page? 回答1: A lot of suggestions here work if you want your alteration to be theme-based, but if you want this to come from a module, using a block region, page template or page prepocess won't cut it, because you're tying the alteration to the theme. From a modular standpoint, the following options