drupal-7

How to preserve the order of the fields to be selected when using $query->addExpression()

本秂侑毒 提交于 2019-12-11 04:08:33
问题 I'm using Drupal 7 and I have to make a union on multiple tables. For the union to work some conditions have to be met: same number of columns same data type same order Some of the tables are missing a column so in order to compensate for that I just add it with something like this: $query->addExpression(':field_1', 'field_1', array(':field_1' => NULL)); . So at this point condition 1 & 2 are satisfied, but the order of the fields in the select is different. See example bellow: $query_1 = db

Does Aegir 3+ support both D7 and D8 deployments

爷,独闯天下 提交于 2019-12-11 01:52:36
问题 We have a current installation of Aegir, old enough to not support D8 installs. Looking to cut over at some point. So that begs the question: Does Aegir 3+ support both Drupal 7 and Drupal 8 installations? To where we could deploy a D7 test site to a D7 server and likewise with 8 from the same Aegir interface? Thanks in advance! 回答1: Does Aegir 3+ support both Drupal 7 and Drupal 8 installations? Yes. To where we could deploy a D7 test site to a D7 server and likewise with 8 from the same

How can I use both Laravel and Drupal in my website?

橙三吉。 提交于 2019-12-11 01:15:19
问题 I have a website build in Drupal 7. Due to complexity of some pages I want to build those pages in framework like Laravel! Can I do that? I want to keep user login and some node functionality of Drupal and will use Drupal's db! 回答1: You can but you shouldn't. The Drupal and Laravel are both back-end frameworks. By keeping some part of Drupal and another from Laravel will create problems for you later if not now. Just for example, you will have to sync session management of both systems to

How to balance webserver bandwith usage?

房东的猫 提交于 2019-12-10 22:04:25
问题 I have a drupal commerce website in which users upload a lot of images all the time. Each commerce order has n images. I would like balance network traffic in order to save bandwidth (bandwidth is limited for each server). I cannot use a conventional load balancing solution because the balancer server also will have a limited bandwidth. My database will be on the separated server. I would like to find a solution for handle request directly in each server and persist the connections by session

Apache Solr: bitwise operations to filter search results

元气小坏坏 提交于 2019-12-10 18:46:26
问题 I need to filter solr search results corresponding the access rights in our cms (drupal 7 + custom access control mechanism based on bitmasks). There exists a Solr QParserPlugin plugin for search results filtering based on bitwise operations on integer fields: https://issues.apache.org/jira/browse/SOLR-1913. I am using Solr 3.6.1 (+ the plugin in /var/lib/tomcat6/solr/lib/bitwise_filter_plugin.jar) on tomcat6 (on debian system) with the schema.xml provided by the drupal module search_api_solr

Is it possible to add multiple location for a single node and solr can show all location for a search?

雨燕双飞 提交于 2019-12-10 18:08:47
问题 The scenario: let's say you have a product in multiple location and when you search for the product (not for location) you should see all locations. In Drupal you can use multivalue fields for locations (but in solr I don't know). When index the product whit solr you should not send it, let's say, 3 time (and hold it in your DB 3 times) just once. 回答1: In sor also, you can have multivalued fields. <field name="location" type="text" indexed="true" stored="true" multiValued="true"/> So the

Core Content types not available

旧时模样 提交于 2019-12-10 18:04:41
问题 I have a weird issue troubling my Drupal site. Upon clicking 'Add Content', my Drupal website automatically redirects to a couple of custom content types that I created using the 'Add content type' feature. For some reason, all the existing core content types such as 'Basic page', 'Article', 'Book' have disappeared. Further probing, when I click the 'Content types' link in 'Structure>Content types', all of these content types exist and are listed, however for some reason I am unable to use

How to attach an image to a node while creating it with node_save($node);

依然范特西╮ 提交于 2019-12-10 15:59:31
问题 Hi i am working with drupal 7 and trying to import data from xml by parsing it using php and later on creating nodes with node_save($node) . So far i have been succeeded to create nodes from xml without any images. I want to attach image to the node while i am importing it. I know drupal 7 is still in alpha 6 but its good. node_save($node) function is almost same as in drupal 6 but little bit different. Ok here is my code image file path is stored in a variable...any help would be great.

EntityMetadataWrapperException: unknown data property for field

自作多情 提交于 2019-12-10 15:26:48
问题 I have recently been trying to update my code to use entity wrappers to access field values. Now I have this: $wrapper = entity_metadata_wrapper("node", $nid); print($wrapper->field_property_sample()->value()); instead of this: print($node->field_property_sample[LANGUAGE_NONE][0]["value"]); The problem is sometimes I encounter this: EntityMetadataWrapperException: unknown data property field_property_sample. Is there a way for me to workaround this? I have about 10 of these fields that can

Drupal hook_views_post_execute not getting called

拥有回忆 提交于 2019-12-10 14:15:50
问题 I'm trying to hook into the hook_views_post_execute event in Drupal 7, my module called foo is located in sites/default/modules/features/foo . My foo.module file contains a definition for the hook_views_api function, defined like this: function foo_views_api() { return array("version" => 3.0); } This function gets called, but my implementation of the hook_views_post_execute does not, it's defined (in the same foo.module file) like this: function foo_views_post_execute(&$view) { $seen_rows =