Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

The tag has no usage guidance.

1
vote
2answers
11 views

Find entries that use a specific block in their Matrix field?

Suppose a Mtrix field named MyMatrixField has three blocks called Text, Images, and Buttons. What MySQL query would list the section and title for all entries whose MyMatrixField field has a Buttons ...
1
vote
1answer
24 views

Joining sections (Channel) to query based on a related item attribute

I've been trying this for a while now, so might have read this before. Sorry about that, I'm struggling really hard to get this right. At first I tried (wrongly) with the eager load features. I have ...
1
vote
0answers
12 views

Paginate entries based on related status

So, let's assume I have two channels. events and movies, being events the screening time of each movie. In the admin, in the event entry, you can select one movie. The movie could be disabled. The ...
2
votes
1answer
22 views

Error on import to Craft production db

I just copied my database across from local server to production server. I used Craft's control panel to create a backup. Then I used Sequel Pro to import this into the live server. I got this error: ...
0
votes
0answers
37 views

“Unsupported DB driver value”

In my quest to get Craft setup on my server, I've run into yet another error. When going to example.com/index.php?p=admin, it quickly redirects to example.com/admin/install, and I get the following ...
0
votes
0answers
15 views

Modifying a custom entry source elementindex key handle?

I have a plugin that uses two custom entry sources within the entries section by using the modifyEntrySources function. I noticed a typo has been made with one of source key handle values. I want to ...
1
vote
1answer
17 views

Use utf8mb4 for database operations

the plugin I'm currently working on has to store user inputs which might contain 4 byte unicode characters like emojis. MySQL is not able to handle this with a utf-8 charset. It works if the charset ...
1
vote
1answer
144 views

MySql 5.7 error - field doesn't have a default value

We've just switched server for one of our sites and I am now encountering a MySql error on one of our plugins. The MySql version on the new server is 5.7 and throws an error as a field has no default ...
1
vote
1answer
112 views

Problem connecting to MySQL db on installing Craft 3

Having installed Craft 3 using Composer, I'm attempting to run the Craft setup. Everytime I try, I get the following error: Testing database credentials... failed: SQLSTATE[HY000] [1044] Access ...
1
vote
1answer
28 views

Does Craft do joined calls or multiple ones when fetching the related items? [Element API]

I'm checking Element API's performance to decide if it's a good idea to replace my own custom API with Element API. Right now, when fetching the related items (Via fields or matrix elements), my API ...
0
votes
0answers
40 views

Craft 2 Query Builder from SQL Help

I am trying to convert a plain SQL query I have into query builder. I am getting close, both subqueries seem to be working independently in the query builder syntax but I am struggling to get the ...
0
votes
0answers
25 views

How to backup Craft 3.x on Wampserver

I'm curious to know if anyone has successfully figured how to backup Craft CMS 3.x databases using WAMP server or the like? This is from the logs: 2018-04-30 05:58:18 [::1][1][-][error][craft\...
0
votes
1answer
53 views

Craft 2.6 incorrect string value SQL error for 4 byte UTF-8 characters when saving entries

On a Craft site that uses the Dukt Twitter plugin I have started seeing SQL errors when saving certain entries that use Twitter data: CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: ...
0
votes
0answers
56 views

SQLSTATE[42S22] Error when trying to update to RC14

I have just tried to upgrade my Craft Installation from 3.0.0-RC1 to 3.0.0-RC14 and I got a 504 timeout error. After boosting max_execution_time I ran composer update craftcms/cms which seemed to work ...
0
votes
1answer
160 views

Alternatives to Mamp Pro – which works with Craft CMS

I've been a long time user of Mamp Pro, but I'm getting an error using v3 with Craft3, due to needing to update to Mamp Pro 4, however after some hrs trying to update to Mamp 4, I can't get mySQL to ...
1
vote
1answer
43 views

Install MySQL stored procedure to database on plugin install in Craft 3

I am trying to add a MySQL stored procedure to the database on plugin install in Craft 3. I currently have an install migration calling a function from the safeUp method. In this function I am using ...
1
vote
2answers
59 views

Importing a Craft database error

I dumped from Craft my database from server A and am trying to install it to a fresh copy of Craft on server B. I've got Craft up and running, and when I try importing my Craft SQL file in PHPmyAdmin,...
2
votes
1answer
112 views

Craft 3 Ubuntu installation error via composer setup

After running composer and then initiating craft setup I keep getting this error: Username: [admin] Email: abc@test.com Password: Confirm: Site name: test Site URL: test.com Site language: [en-US] ...
1
vote
2answers
360 views

How do I get past this MySQL error installing Craft 3 using CLI

I am using https://box.scotch.io/ (vagrant). I'm trying to install Craft 3 with the cli, but can't get past these errors: Connection refused No such file or directory One or the other error shows ...
1
vote
1answer
31 views

Publishing entry returns Internal Server Error (1030 Got error 139)

Trying to publish changes in one of 3 locales of an entry gives error: Internal Server Error CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1030 Got error 139 ...
1
vote
1answer
81 views

MySQL CPU pegged on specific query

Very similar (almost exact) to this question: Poor performance on midsized site / Queries without index? CPU keeps getting pegged to 100% for MySQL, which makes the admin interface very slow (the ...
3
votes
1answer
31 views

Workflow for re-using data structures and setups across projects?

I am wondering if there is a way to re-use pre defined field types and image crops over various Craft projects. I currently in the process of e.g. manually defining 20 different image crops I already ...
6
votes
2answers
854 views

Craft CLI RC1 Connectivity Issues with MAMP Pro

I've been trying to run the new Craft CLI for the last couple of versions without any success. I figured maybe since we weren't at RC1 yet that it wasn't fully working. After seeing Ryan's video about ...
1
vote
1answer
52 views

Craft 2.6.2999 install error: Base table or view already exists: 1050 Table 'craft_entryversions' already exists'

I keep getting stranded at the "Oops" modal on install. This is on the third Craft site I've started. The other two Craft 2 sites stood up fine, an I've been developing them for nearly a year. I've ...
1
vote
0answers
53 views

Creating coupon using Charge 2 plugin

I just updated the Charge 2 plugin to latest (version 2.2.1) and when I try to create a new coupon, I get this error: CDbException CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: ...
0
votes
0answers
91 views

Base table or view already exists: 1050 Table

I don't know if this is the proper place to ask my question, as I'm running into this error on a local development setup with Vagrant/Homestead. I'm getting the "oops" screen during the install. ...
1
vote
1answer
27 views

Pruning the users table

I have a site that deals exclusively with user generated content. After a few years, the users table is getting to a stage where it can probably be pruned of folk who have registered but not actually ...
0
votes
0answers
17 views

Ghost submission entries in amforms data transfer

I have a temporary site I've created that is currently accepting applications using amforms. Meanwhile, I am building a new site on a staging server that will eventually replace the temp site. ...
1
vote
1answer
80 views

MySQL Error 1064 when trying to create a Matrix

Running Craft Version 2.6.2994 on an EC2 instance that has PHP 7.0.21, and MySQL v 5.6.37 installed. When I try to create a new Matrix, I get the following error when saving. When I test this on my ...
0
votes
0answers
68 views

SQL error Craft 2 on MYSQL 5.7 error Syntax error or access violation: 1055

Running into all sorts of issues with this and none of the known solutions work for me. Setting /etc/my.cnf with: [mysqld] sql-mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,...
1
vote
1answer
49 views

Base table or view already exists

Getting the following error on production environment when trying to add a new Field. CDbCommand failed to execute the SQL statement: SQLSTATE[42S01]: Base table or view already exists: 1050 Table '...
1
vote
2answers
34 views

What might cause logins to work locally yet not in deployed environment?

We're getting a 404 (or a Craft 'page not found' error) with this path on the remote server: http://foo.example.net/admin/actions/users/login Same database using remote mySQL. Local logins work fine....
1
vote
0answers
62 views

Problems while setting up a cross region Craft website in AWS

In order to create a cross region setup for my craft website, I've created a read-only replica of my RDS DB from North Virginia region to Canada Central region. I'm facing the internal server error ...
3
votes
1answer
230 views

Entry view count in the last 24 hours

I'm working on a typical craft blog with articles. I know there is a plugin that was used to teach craft plugin development that tracks entry visit counts here: https://straightupcraft.com/craft-...
1
vote
1answer
274 views

SQL Error - cannot add foreign key constraints

I'm uploading a site to a new environment and getting the following error: The assetfiles table structure:
0
votes
1answer
67 views

Help with admin panel errors. Fresh install. Mysql version issue? [duplicate]

I get this on the admin panel: CDbException CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #18 of SELECT list is not in GROUP BY ...
3
votes
1answer
218 views

Poor performance on midsized site / Queries without index?

I'm running a mid sized website (couple hundred articles, between 30-50k visits per day) on a Digital Ocean 16GB / 8 Cores web server and I have two questions: Most of the time the website runs ...
2
votes
2answers
197 views

See the SQL query that gets executed when saving entry

I'm creating a pretty specific entry with some fields. And I want to create the from a third party app. For that, I'd like to see the SQL query that get executed. I've tried it with events, entries....
1
vote
1answer
306 views

Internal server error in Admin after migration

I'm setting up a website using Craft Cms. Everything was working fine on local dev, but now I moved it to a development server, I'm getting an error every time I try to create a new entry (or section)...
1
vote
1answer
63 views

Tagging all assets in a sub directory

I'm building a project with a lot of photo assets organized into sub directories of the main photos asset source. I'm trying to add tags to these assets so they are searchable when I try to use them ...
2
votes
1answer
125 views

DB back-up gives syntax errors on import in new DB

I had this issue on two different sites on two different occasions and hosts. When creating a database back-up through the Craft CMS admin and importing that SQL file into a new database through PhP ...
1
vote
2answers
99 views

Order entries, exclude 'the' from order criteria

I know this is partly a Twig question, but I've poked around quite a bit here, in Twig docs, Craft docs, and cannot find the right syntax. I have a bunch of entries with titles like: Hotel A Grand ...
3
votes
1answer
483 views

Dump SQL query in Twig template

Is possible to dump a query made on a twig template for a statement like this one for example: craft.entries.section('homepage') Can we some how see the actual SQL query ?
1
vote
1answer
3k views

PHP notice unserialize(): Unexpected end of serialized data

Ok so this is an incredibly wierd one and I have no idea how to explain the problem in just one sentence so I just put the error message as the title. So I am building a site with craft...in fact its ...
0
votes
1answer
155 views

Update record definition after plugin is already installed

If you have a plugin installed with its own tables and you want to add some extra database fields to the table, what is the process for this? Craft will create database tables using records on ...
1
vote
0answers
117 views

Error while sending QUERY packet in continuously running process

I'm using php-resque + Redis to get queues/workers into Craft, and so far I've managed to get it all running. My test worker looks something like this: <?php namespace Craft; class JobHandler { ...
1
vote
1answer
266 views

What's the difference? SQL_MODE error in one site and not the other

I have 2 Craft sites that share the same Craft codebase. For both sites, i was getting the following error: Internal Server Error CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: ...
3
votes
1answer
800 views

MySQL Collation: utf8mb4_unicode_ci (emojis)

The Craft docs call for using utf8_unicode_ci for MySQL collation. MySQL 5.5.3 introduced support for utf8mb4_unicode_ci, which, I believe, is required to support the storage of emojis. Does anyone ...
2
votes
1answer
163 views

How would I write this differently to make it compatible with MYSQL 5.7

There is an issue with using unique => true in defining an attribute as a primary key when using MYSQL 5.7.*. protected function defineAttributes() { return array( 'eid' => array(...
1
vote
1answer
107 views

Map one asset attribute field to another using MySQL

In Craft, is it possible to map one field containing string value to another? I have a bunch of image assets that has a title field and altTag fields. I've entered data into the alt tag field, but ...