drupal

connect mysql to postgresql

我与影子孤独终老i 提交于 2020-01-05 05:51:06
问题 i'm working with a drupal installation, that uses mysql to create a new user, that has to put his email to be created (its type in mysql is varchar(64)), and then goes to the actual webpage, that works with postgresql, and the user has to put his email another time and then save. Actually the new user table is created in postgres as soon as he puts the email (primary key). what i would like is a function, or something that as soon as the new user is created in mysql, it automatically connects

A Drupal view to show the top rated node per day, each day for a year?

 ̄綄美尐妖づ 提交于 2020-01-05 05:30:47
问题 I have a site with user generated stories. Stories are nodes. Stories are rated with Fivestar. I want to create a calendar style view to list the top rated story - every day, for the current year. So at the end I will have a list of 365 stories. I'm not sure how to approach this, any help would be great. 回答1: You could make a View that takes a Date argument, where you'll pass a specific day', and return results sorted by Fivestar rating, and limiting the View to 1 result. Then in your custom

How to query cck field in drupal?

隐身守侯 提交于 2020-01-05 02:58:21
问题 I have two content types (job_post and application) linked using the node reference + node reference url nodes. When I click a link in a job_post node, a new application node is created, so that candidates can fill out their job application. My goal is to automatically copy the content of an cck email field from the referenced job_post node to a cck email field in the application node. To achieve this,I have created the following module: // Implementation of hook_perm() function mymodule_perm

Drupal - upgrade from 8.6.7 to 8.8.1

六月ゝ 毕业季﹏ 提交于 2020-01-05 01:40:08
问题 I have upgraded using below command https://www.cloudways.com/blog/update-drupal-8-core/ https://alvinalexander.com/drupal/how-update-drupal-7-website-with-drush drush pm-update After update it gives below error Fatal error: Class 'Aws\S3\StreamWrapper' not found in //web/modules/contrib/s3fs/src/StreamWrapper/S3fsStream.php on line 23 I also added latest AWS SDK composer require aws/aws-sdk-php Any idea how to fix this? [UPDATE] Before Upgrade 8.6.16: composer.json composer.lock config ->

Adding content created by custom module to drupal search index

狂风中的少年 提交于 2020-01-04 14:12:09
问题 I have developed a module to create content for my site without using CCK. The data will be saved in different tables other than the default tables of Drupal. My requirement is, how can i make Drupal to index the content created by my custom module? 回答1: You will have to implement hook_search in your module that indexes your custom content. 来源: https://stackoverflow.com/questions/4816851/adding-content-created-by-custom-module-to-drupal-search-index

Drupal Views exposed filter of Author name

十年热恋 提交于 2020-01-04 09:05:08
问题 I have a view which I would like to add an exposed filter of the author name. So I can filter all the posts created by "John Smith" etc. I can't seem to see it listed under filter. Is this possible to do? 回答1: Under Build > Views ( /admin/build/views ) add a filter (from filter category user ) click Expose in the filter configuration section (near to the right border). 回答2: This is actually a little harder than it sounds. You need to create a "Relationship" to the "Node revision: User", and

Count number of results in a View

不问归期 提交于 2020-01-03 20:04:16
问题 I need to count how many people belong in pre-defined groups (this is easy to do in SQL using the SELECT COUNT statement). My Views query runs fine and displays the actual data in my table, but I simply need to know how many results it found. However there doesn't seem to be a COUNT option in views. I am guessing I am going to have to use some sort of views hook, and then stick the result in the table. Here's a quick example of what i'm trying to achieve: My Table ---------------------- Group

Adding url() breaks hook_mail implementation

此生再无相见时 提交于 2020-01-03 19:02:13
问题 I'm writing a module in Drupal-7 that dynamically sends a one-time login link to guests. Everything fires fine until I add the link to the $message array, when it chokes. If I do a dpm($message) the link appears in the $message['body'] array, as I would expect. If I comment out the line with the url() function, everything works as it should. Why is php/Drupal choking on this silly little link? /* * Implement hook_mail(). */ function rsvp_mail($key, &$message, $params) { switch($key) { case

Check cookie and redirect with Apache

ぃ、小莉子 提交于 2020-01-03 17:24:50
问题 I'd love to get some feedback on this. I'm not sure if it's the right approach. The details I'm running Apache 2 with PHP 5.3/MySQL 4 and Drupal 6 is the platform. I'm developing a site which contains restaurant reviews in a couple of selected cities. When the users arrives at the site it can choose which city is theirs. I store their choice in a cookie and if they haven't made a choice I've selected a default city. Proposed solution Now I want the URL mydomain.com/reviews to redirect to the

Drupal field_settings_form

醉酒当歌 提交于 2020-01-03 03:21:08
问题 I made my own Field in Drupal for an address. It displays things like street, number, zip,... So far so good. But for some reason, ALL field are required. Although there are set required in the UI or the Array. So I would like to edit it's field_settings_form. I found myself an example in the Drupal-core code, but it doesn't help me a lot. Goal of the field_settings is to make the fields visible or not and required or not. So I came up with this code (I got it from user_reference.module )