Questions tagged [database]

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

Filter by
Sorted by
Tagged with
-1
votes
0answers
39 views

How can I have a faster remote Database?

I'm new at working with Drupal remote/team. We use git for commit local file, like theme, modules etc. I have used acquia to work with remote DB with different developers but that option is paid and ...
0
votes
1answer
13 views

Database Abstraction to Fetch published content of specific content type throwing error

I'm attempting to grab all published content of type 'homepage_slide', as currently my slider loads all content unpublished or otherwise. Here is my current Abstraction query. if ($variables['...
0
votes
0answers
24 views

Querying entities taking an insane amount of time

Is the entity system in D7 not very well optimized? I am trying to iterate through 1500 entities using EntityFieldQuery(), and I had to extend my execution time to 300 seconds in order for the ...
1
vote
1answer
40 views

What is error: “Base table or view not found: 1146”

Base table or view not found: 1146 Table '(database).(entity)__(field_name)' doesn't exist I have problems running my site since i deleted field (field_name) from entity (entity), to be clear entity ...
0
votes
0answers
28 views

How to get only published revisions of a node?

I have several types of content that are moderated(content_moderation and workflows), in a custom validation process I need to know if a particular node has at least one published revision. Is there a ...
-2
votes
1answer
42 views

Installing a module on a separate database

I currently have a Drupal 7 site with a big database. I have to install the Drupal Commerce module and I would like to install the module using a separate database. I know I have to setup the second ...
0
votes
0answers
35 views

Notice: unserialize(): Error at offset XX (removing Paragraphs)

I'm trying to remove Paragraphs and modules related to it manually (because I can't remove it completly from admin page). I'm using UTF8 without BOM in Notepad++ when editing key_value BLOB file that ...
0
votes
0answers
17 views

How to disable all webform modules from phpmyadmin [duplicate]

How can I disable all modules related to the webform (WEBFORM EXAMPLE, WEBFORM DEMO and WEBFORM) from the phpmyadmin? Since I installed them all I am unable to access the admin panel. It does log in ...
1
vote
0answers
40 views

Drush cannot connect to the database when updating

I am trying to update Drupal from version 8.7.5 to 8.7.7. I installed Drupal using composer and had a really old version of Drush that I had installed from apt-get. I uninstalled the old version and ...
1
vote
0answers
21 views

How to create a query nodes, that queries content with more than one comment?

Consider this example: $query = \Drupal::entityTypeManager()->getStorage('node')->getQuery(); $nids = $query->condition('type', 'question') ->condition('status', 1) ->...
0
votes
0answers
13 views

Items removed from Node Reference field are still displaying on the node

This problem only very recently cropped up; I've never encountered it before. I have a content type (Resource) that contains a Node Reference field (pointing to Organization nodes) that allows ...
1
vote
0answers
28 views

Delete user in transaction

I'm having trouble figuring out why the following code isn't working in Drupal 7. _queue_processor is a cron queue processor function: function _queue_processor($uid) { $transaction = ...
0
votes
0answers
26 views

How to add a UNION to a query in hook_views_query_alter?

I have a custom multiple-value field (via plugin) in a bundle that needs to have an dynamic entry added prior to rendering in the view. I've tried render hooks. The problem is that if there are ...
0
votes
1answer
27 views

How can I run a Views SQL query in PhpMyAdmin?

i go to admin/structure/views/settings, check Show information and statistics about the view during live preview and then Show the SQL query checkbox that will appear below. I have a field which is ...
0
votes
1answer
50 views

How to save the webform data to custom table?

I designed a student registration form using webforms module. My requirement is to save data from the form to table student. How can i achieve this? Is there anyway to mention this in configuration ...
0
votes
0answers
24 views

Expose custom db table to views to join with any entity data

We have a db table from custom module which has fields entity_id and entity_type. I need to exposed this table to views using hook_views_data() and it should be possible to join with this table within ...
1
vote
1answer
54 views

Can I get integers from a dynamic query using fetchAllKeyed?

So basically I want an array of integers from a query using fetchAllKeyed for the results. The field is an tinyint in the db so I would expect an indexed array of integers but I am getting an ...
1
vote
1answer
34 views

Fetching node field values programmatically

I have figured out how to query the node table programmatically without using the deprecated db_query() function. However, I soon discovered that the actual content fields are not held in the node ...
0
votes
1answer
11 views

Entity wrapper save using db_transaction()?

I am using a db_transaction() for some data updates. I am using some EntityMetadataWrappers, modify some data, then save. The thing is, the wrapper ->save() function doesn't have a parameter for $...
1
vote
2answers
47 views

Is it normal for a database to have 3600 tables?

I recently inherited a Drupal site and while trying to migrate the site and DB I noticed that the DB is 1GB+ and had 1000s of tables. This is the first time i work with Drupal so I'm not sure what ...
1
vote
3answers
20 views

Query fieldCondition for custom content type

I am attempting to query a custom content type called players (machine name) in a Drupal 7 module and it seemed to be working fine up until an hour ago. Nothing has changed on my side but now the '...
0
votes
1answer
26 views

Add second expression to query

I have a probably trivial question, but I could not find an answer. I have this query, which works fine: $query = db_select('books, 't'); $query ->fields('t', ['publication_year']) ->...
0
votes
0answers
33 views

Primary-replica using PostgreSQL

I have master-standby servers on PostgreSQL working perfectly. I followed Database Configuration and edited the settings.php file to contain the following code. $databases['default']['default'] = ...
-1
votes
1answer
57 views

How do I pull data from an external database, and display it in Views? [closed]

I am fairly new to Drupal, and just started working with Drupal 8. I know a table can be generated in Views for the content which is displayed/used somewhere on the site, and a table can also be ...
-1
votes
1answer
32 views

List files in a directory as a table

I created a folder inside of my Drupal directory where my client can directly FTP into and upload or remove PDFs. What I'm trying to do is create a page called "Documents" which then displays all ...
0
votes
0answers
20 views

Can a cached query being used as another query select?

I've got a query as follows : $selected_services = array(512, 825, 912, 913, 936); $query = db_select('users', 'u'); $query->join('users_roles', 'ur', 'ur.uid = u.uid'); $query->join('role', '...
1
vote
1answer
29 views

Looking for core Drupal table DDLs

My Drupal 7 installation has a handful of tables that have been corrupted. Attempts to repair them have not been successful so my best chance of being able to move forward is to recreate them. I have ...
5
votes
1answer
472 views

Why does loadMultiple load 1000 nodes 9.2 times faster than loading each node one by one?

I have always known that loading multiple nodes at the same time is faster than loading them one by one. What I wasn't aware of, is the huge performance difference between the two ways of loading ...
0
votes
0answers
5 views

Unable to install site when attempting to upload a Background Process module

We recently added a new module Background Process to our local drupal environment by running the command drush en background_process -y. After installing, I was able to use the method ...
0
votes
0answers
39 views

Listing two different custom entity types in one view

We defined two entity types, questions and answers. They are related to each other but we will need a view listing all questions and answers in order of title or created date for example. When you ...
2
votes
1answer
30 views

Is there a way to get the max size of a varchar textfield?

I have an entity with a textfield created using the core Fields feature that looks like this when I inspect the type of the field table in the database varchar(40). I want to be able to determine max ...
0
votes
1answer
62 views

Where in the MySQL database schema is the URL alias for a group relation?

I am building a report outside of Drupal that pulls data from a Drupal 8 database. The report shows titles of different nodes and I want to link those titles to the web page for that content. This ...
-2
votes
1answer
19 views

Slow page load (seemingly large pulls from MariaDB)

We have a Drupal 8 site running on Windows/Apache/PHP7.2 that pulls data from a MariaDB server (on a different subnet - ie not in our DMZ) also running Windows. When a user is signed in to Drupal the ...
-1
votes
1answer
87 views

Fetch and update with foreach loop

I need to update the database. the code I am using was working, but after I have done some Drupal updates, it doesn't work anymore. I'm fetching data from table all is working but when I add code ...
0
votes
1answer
134 views

Delete a field from the database manually

I installed a module that left a ghost field that isn't tied to any entity bundle :( How would I go about safely and thoroughly deleting this field from the database? I have to delete this field to ...
-2
votes
1answer
20 views

Is there a way to determine creator of each table on an existing Drupal DB?

I am investigating Data Science stakes for a company and have started by exploring the data they have. They are running their website on Drupal (7.59), which, compared to a "traditional" relational DB ...
0
votes
0answers
17 views

Add a FULLTEXT index on specific column

I'm currently implementing a custom search engine in my custom module. In order to optimize my module, I would like to perform SQL queries by using the syntax MATCH....AGAINST in Entity queries. By ...
1
vote
1answer
37 views

How can I display custom data from the database in a View?

I'm working to create a new website in Drupal 8 and cannot figure out how to reference custom table data within a View. Specifically, I have a script that is taking data from an external DB and ...
0
votes
2answers
41 views

How to query external database for Count

How do I query the below SQL query to an external database table from Drupal 8 custom module, Select Count(requestID) FROM requestDB.request where request.dateCreated >= DATE_SUB(CURRENT_DATE, ...
0
votes
0answers
21 views

InnoDB not locking a SELECT statement using db_query()

From Any way to select without causing locking in MySQL? I found a way to implement a select query in a InnoDB table without locking. The example code given there is the following. SET TRANSACTION ...
0
votes
1answer
52 views

How owerride entity node delete core function

I'm doing a headless drupal cms. I need to check the entities before they are deleted. I need to do it globally as the deletion of entities can take place via api (already written) or by using the ...
0
votes
0answers
19 views

Installation on Oracle database using the Oracle driver

I have been trying to install/host Drupal 7 on Oracle Database as the primary database for last few days without any luck. Here is the Oracle driver link that I have looked at https://www.drupal.org/...
0
votes
1answer
32 views

Extra Content Appears Below Footer

I have an issue where I have the page for a specific role showing up on every page and additionally an error message. These show up below the footer on the pages. I've gone through the theme files ...
0
votes
0answers
47 views

Install in a specific PostGreSQL schema

I want to install & setup my Drupal databases in a specific schema of the PostgreSQL database. For example, let's say I have created a schema named "test_drupal" in my existing PostGreSQL database ...
0
votes
0answers
56 views

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1074 Column length too big

I am trying to update my database collations to utf8mb4 to support more characters (like emojis etc.) following this guide: https://www.jeffgeerling.com/blog/2016/getting-emoji-and-multibyte-...
0
votes
0answers
18 views

File uploading issue

We're having issues uploading files. Some files encounter an error message that states The specified file temporary://p1dah901n910tl8lv14.tmp could not be copied, because no file by that name ...
-1
votes
1answer
36 views

Drupal maintenance over several environments [closed]

I have a production environment for a Drupal 7 site. This environment is replicated to a staging environment, which we use for testing updates to modules and drupal core (same major version). We ...
1
vote
3answers
1k views

How do I perform outstanding entity updates after 8.7?

I have just tested the update to 8.7.1 (from 8.6.x) which includes the removal of the old automatic entity update functionality, which means drush entup no longer works. As far as I understand the ...
0
votes
0answers
8 views

use TableSort with multiple database tables?

I have a custom module where i want to show a table on a page. The rows of this table are the representation of a list of objects stored in database table A. Most of the columns show data from ...
0
votes
1answer
177 views

Error when upgrading to Drupal 8.7.1 on module menu_link_content

When running database updates (on domain.com/update.php) from 8.6.15 to 8.7.1, I got the following error: module menu_link_content Update make_menu_link_content_revisionable Custom menu links have ...