Drupal provides a standard, vendor-agnostic abstraction layer for accessing database servers.

learn more… | top users | synonyms (8)

3
votes
2answers
42 views

How can I ensure I retain access to a Drupal site after handing it over to a client?

Does Drupal have a mechanism which will allow me to keep control over a site after handing it over to a client? If things go wrong with the client relationship, I need to be sure I still have control ...
0
votes
1answer
19 views

When a link is clicked, a value is retrieved from the table and displayed on a Webform field

I have created a basic page with two buttons, "Yes" and "No". When the "Yes" button is clicked, it is directed to the webform. Aim: When the webform appears, it displays a value from the table into a ...
0
votes
0answers
8 views

Display data on checkboxes when a webform loads

I have data from a table "customer" in this format: "data1,data2,data3," Examples: "tenant, training, consulting" "other" The key-value pairs are for the component of the webform are: ...
0
votes
1answer
51 views

How so I execute $query->orderBy('FIELD(node.nid, 5,12,3,6)', 'ASC')?

I am currently converting code from Drupal 7 to Drupal 8. So far I am unable to find resources on how to convert the call to orderBy() which uses an expression. $query->orderBy("FIELD(node.nid, ...
0
votes
2answers
16 views

hook_views_data join table on multiple columns

I have 3 tables lms_user, lms_answer_initial and lms_model_answer and need to join them to display a view on certain columns. I can successfully join the first 2 tables (lms_user, lms_answer_initial ...
0
votes
1answer
8 views

VotingApi function takes time to update the database

I have added a menu item that calls a function that calls votingapi_set_votes and delete votes. This function works locally fine but when uploaded to the hosting and when i call the function it takes ...
1
vote
1answer
22 views

Create a page with database data in a module

I am new to drupal and in a process of developing a custom module. My module will do a couple of things: (ADMIN) User will be able to select a zip file and upload it (ADMIN) The module will than ...
2
votes
1answer
21 views

What causes my problem when trying to create multiple tables in hook_schema?

I'm working on a module that has 2 tables and this is my code: function gen_schema(){ $schema = array(); //table cv $schema['cv'] = array( 'description' => 'table contenant les cv.', ...
0
votes
0answers
12 views

Understanding Relationship Between `file_managed` and `file_usage` tables

I am trying to understand the Drupal database schema because I need to access the database via MySQL by another system and I do not have access to the original Drupal developer of the site nor do I ...
2
votes
2answers
25 views

Understanding `file_usage` table

I am trying to understand the Drupal database schema because I need to access the database via MySQL by another system and I do not have access to the original Drupal developer of the site nor do I ...
1
vote
1answer
11 views

Understanding `file_managed` table

I am trying to understand the Drupal database schema because I need to access the database via MySQL by another system and I do not have access to the original Drupal developer of the site nor do I ...
0
votes
0answers
36 views
+100

Cannot change an existing field's type. in field_update_field() line 240 of field.crud.inc

My instance of drupal is throwing an error. The file that is throwing the error is modules/field/field.crud.inc The error is FieldException: Cannot change an existing field's type. in ...
0
votes
1answer
17 views

Entity query - wrong nid

Hi i have following querry: $query = \Drupal::entityQuery('node')->condition('type','article'); $result = $query->execute(); Then i want to access all content: $nodes = ...
-1
votes
0answers
12 views

Display data in a textfield from a table found in the database when the webform load

I have a table named customer with only one field called Company_Name. I want it to display a value from the table when the webform is loaded. Query to retrieve the data: $result = ...
0
votes
1answer
31 views

Query - Content type [closed]

i want to get all created content of some content type by query. By now i can acces nodes by their ID. $MyNode = \Drupal\node\Entity\Node::load(1) I tried some query, but none of them worked for ...
1
vote
0answers
9 views

How can we configure the Master slave concept for moving field data to slave database?

How can we use drupal master slave setting to push field data into slave database and starts using field data from slave database? Is it even possible with drupal 7?
1
vote
1answer
17 views

SQLSTATE[42000]: Syntax error or access violation in drupal views query [closed]

When trying to preview a view containing references to three Field Collection module fields, I get the following error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in ...
5
votes
3answers
47 views

How can I programatically prevent users from saving the same entity twice in a row?

My server sometimes gets overloaded, and sometimes people press the "Save" button on an entity creation page several times, which results in multiple versions of the same entity being created. So, I ...
0
votes
0answers
17 views

better exposed filter ajax call was very slow [duplicate]

I have an exposed auto-complete taxonomy filter, It takes time(5 to 6sec) to load the values. How to increase the performance to load the values quickly.
0
votes
1answer
12 views

Taxonomy term reference field from custom database table

I am trying to create a taxonomy term reference field or the equivalent in a View that uses the uuid of a field in a custom table. This field can contain multiple uuids. My first approach after ...
0
votes
1answer
18 views

Insert multiple checkbox value from webform into table

I created: a webform named Test Number checkboxes checkboxes named Number with values one, two and three using Form Builder a table named checkbox_check Aim: When the webform is submitted, the ...
0
votes
1answer
24 views

Retriving nodes by content type using Drupal::entityQuery

I created a content type named product. How can I retrive all node of such content type using the entityQuery method? I tried with this, but it doesn't works: $ids = \Drupal::entityQuery('product') ...
0
votes
0answers
7 views

Use webforms to search and edit information from a custom table on the database

I am attempting to search and edit information by using 2 webforms. The custom table is found in the database that my Drupal project is using and is named "test_update." It has 2 records on the table. ...
0
votes
1answer
23 views

Using xdebug to find out why a variable is mysteriously set to 0

Thanks in advance for your help! I'm new to xdebug and trying to figure it out. I have a situation I'm trying to debug where a variable is mysteriously set to 0. I know from xdebug (I'm using ...
3
votes
2answers
80 views

What code should I use where I used db_query()?

I want to execute SHOW TABLES in Drupal 8. In Drupal 7, I would use db_query("SHOW TABLES"), which is deprecated in Drupal 8. What should I use for Drupal 8?
0
votes
2answers
18 views

Check whether a field value exists in a custom table when a webform is submitted

I created a custom table named "test_customerid" for the use of select queries from the drupal database. The fields are naid (for national id), name and surname. My aim is to display an error message ...
0
votes
0answers
17 views

Creating node flag type causes site to crash

I use Flag module and whenever I try to create a Node flag type I get this error: PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT r.rid AS rid, r.name AS name ...
0
votes
1answer
37 views

How and where to use/place database queries when a webform is submitted?

Let's say that I already created a webform with fields Customer Name, Customer Surname and Customer Address. When the webform is submitted, I want to insert those values captured in a custom table ...
0
votes
1answer
26 views

How to do a date range entityQuery with a Date only field in Drupal 8?

In Drupal 8, the Date only field stores data in a varchar column in a CCYY-MM-DD format, e.g., 2016-04-18. As such, you can't simply do a greater than (>=), less than (<=) or similar timestamp ...
1
vote
1answer
30 views

How do I completely overwrite an array in JSON serialized data field

I am storing an array as a JSON encoded serialized data field in Drupal 7 using the Serialized Field module. If I have an array of 20 elements and try to overwrite it with an array of 10 elements, I ...
0
votes
0answers
14 views

Restful API: Change date format from unixtime to ISO-8601 [duplicate]

Applying the date_iso8601 Drupal function in a simple process_callbacks on the public_fields in the class file for each date field works to convert the output/display of the date format, but does not ...
0
votes
1answer
22 views

Fetch user's realname (from Name Field) within database query (or an alternative method)?

I'm building a custom field for a form based off of the values stored in a user reference field. The options for this field are being built from the following database query: <?php // Fetch the ...
0
votes
0answers
16 views

how i get domain sitename from database

i have created new column in the {domain} table called : sitename_ar and i created a Rules : after saving new content : set data value and the data is : <?php $domainGet = ...
0
votes
1answer
21 views

AJAXX AutoComplete joins and unions causing error

I am a bit out of my depth here. I have successfully implemented my own autocomplete field of an entityform, the following link was my roadmap Textfield that uses AutoComplete. But I am trying to do ...
0
votes
1answer
32 views

how to get row field for each node

i created a field called : (sitename_ar) and i have two rows (two domains) in {domain} field : and i have in my database these two fields {node} and {domain_access} : and i want display in ...
1
vote
1answer
21 views

How to display data from external tables in Drupal without coding?

I want Drupal users to be able to display data from external databases. There is no processing involved, just listing the results based on filters. What Drupal 7 techniques are capable of ...
0
votes
0answers
48 views

Create and update nodes via a module in Drupal 8

I have a module that is creating two new content types, one will have a title, a term reference, and a node entity reference to the 2nd content type. The second one will be composed of 2 integer value ...
4
votes
2answers
272 views

In a general sense, what is the purpose of the Drupal DB Semaphore Table

I understand the purpose a semaphores in IPC programming but I'm not finding a good -- or any -- explanation as to this tables purpose.
1
vote
0answers
25 views

Using Views without Database Support

We build a Drupal 8 based content management system that uses a triple store as the main data back-end. So we don't have any content data in Database tables. All CRUD operations on entities stored ...
0
votes
0answers
16 views

Can Drupal connect to MySQL Fabric managed nodes?

How can Drupal application make use of MySQL Fabric setup using one of the provided connectors from MySQL?
1
vote
1answer
30 views

Drupal 8 Looking for an elegant alternative of rowCount in a query

In Drupal 8 we can not use the rowCount property anymore in case of a select statement. Is there an elegant alternative? I can use a foreach, but when converting from Drupal 7 I would like to replace ...
3
votes
2answers
26 views

Is it safe to use a custom value for users.status column

Currently status column can have only 2 values: 0 - inactive 1 - active I need to add a new status for the user: temporarily inactive. Will it be safe if I use status = 2 for it?
0
votes
0answers
25 views

drush updatedb -y , get Drush command terminated abnormally due to an unrecoverable error

My sites was setup with multiple sites using one single core drupal module I try to update site1, site2 with this command drush updatedb -y I get the success message but for site3 with the same ...
0
votes
1answer
9 views

How to process field input so b52 goes into database as B-52

Situation: D7 Text field on a content type. User enters something like: b52 I want it stored in the database as: B-52 I have a function that does the regex. I just don't know where to process the ...
1
vote
1answer
27 views

Un-promote all other nodes when one node is promoted to front page

I have an instance for a specific content type that at any given time there can only be ONE item promoted to the front page. I have a view that looks for this value and displays the item in a block on ...
0
votes
1answer
25 views

drush sql-sync doesnt extract gzipped sql

I run the following command from a script: drush -v sql-sync @tmp.stage @tmp.coe | tee ./sql-sync.log My @tmp.stage server is Drush 7.0 and @tmp.coe servers is Drush 6.2.0 An SQL dumpfile is ...
0
votes
0answers
14 views

Catchable fatal error on simple database operation

I work with D7. I have to fill up a table on submit of my module's form. But when I put any db_ function I get Catchable fatal error: Object of class stdClass could not be converted to string in ...
0
votes
1answer
24 views

Integrate SQL Query into views

I manage a Wordpress site for a football team, and I created therefore a SQL Query to calculate the standings. Now I want to switch over to Drupal and for the calculation of the standings I thought to ...
1
vote
1answer
28 views

How to insert a new column into mysql field data table?

How would I insert a new column into mysql field data table? For example, if I have a field (myfield) with the mysql table field_data_field_myfield having the following columns'entity_type', ...
1
vote
0answers
15 views

Acquia Dev desktop local Database setup in combination with staging server Database

I have a central remote Git repo (Bonobo git server) where I track all the Drupal 8 code etc. We have a staging server already up and running installed with Drupal 8. I cloned the remote repository ...