Questions tagged [craft3]
For use with questions relating to the Craft 3 version of Craft CMS, including the Beta and RC releases.
1,917
questions
1
vote
2
answers
138
views
Stop customers from increasing line item
I have a site where the owners want to stop customers from ordering more than 1 type of item.
The Twig logic is already in place to stop any forms showing that would allow customers adding more than ...
0
votes
0
answers
22
views
Multiple errors attempting to migrate MariaDB Craft CMS 3 database to PostgreSQL via pgloader. Alternatives?
I've been at this for a couple days now and it's not looking good. I'm trying to migrate a Craft CMS 3.9.5 (latest) database running on MariaDB to Postgres using pgloader 3.6.10.
I've attempted this ...
1
vote
1
answer
36
views
Session token error/missing after server switch
I am duplicating a Craft 3 site from a production environment to a dev environment (local with MAMP Pro). On the "new" dev site I can't log into the control panel. The credentials are valid ...
1
vote
2
answers
46
views
Cleaning up twig query with nested and/or where
I have troubles understanding the nested twig query syntax. It works fine in PHP code but somehow when using twig I never seem to get it right.
This is my raw, dirty query which I want to clean up a ...
1
vote
1
answer
56
views
I have an existing project called Craft cms v3.3, what should I do if I want to run it at local?(Mac OS)
I currently have a project that is definitely craft cms v3. I want to run it but this is the first time I keep stressing over it. Please help me
1
vote
1
answer
60
views
Craft 3 DDEV Migration: "No database has been selected yet"
I've hit a snag while trying to move my Craft 3 project from MAMP to DDEV. First I installed a new DDEV project using the php project type and MySQL 8.0 for the database. Then I imported the database ...
1
vote
1
answer
67
views
Updated to PHP version 8.1.22 and one of my Craft 3 sites is getting a critical error
I upgraded my server to PHP 8.1.22 in order to start a new Craft 4 site, and one (but not all) of my existing Craft 3 (3.6.17) sites is giving me the following error. How do I resolve this error? See ...
1
vote
0
answers
36
views
Bulk Entries Migration works on local, but not updating elements in production
I'm trying to bulk update records based on a condition but the entries are NOT getting updated even though the migration seems to go through. Both code samples below work locally but NOT in production ...
1
vote
1
answer
64
views
How to extend or override CP template?
I need to add some custom condition to the top siteMenu selector.
Template file with top menu:
vendor/craftcms/cms/src/templates/_elements/sitemenu.twig
Block with this menu:
vendor/craftcms/cms/...
0
votes
1
answer
21
views
Upgrading to Craft 3.7 errors
i am trying to upgrade one of my sites up from Craft 3.6.17 to 3.7 and if i try and upgrade at all i just seem to get the following errors:
Any ideas what I need to do?
Database Exception: SQLSTATE[...
0
votes
0
answers
37
views
Prevent user email validation message showing twice In craft panel
When i enter same email which is already exist and click on save it is showing twice message. Can you please tell me it is craft cms's behavior?
I have checked by disable custom modules and also ...
0
votes
0
answers
27
views
Changing Matrix Field Propagation Settings
I built a Craft multisite a few years ago. Most of the site pages feature a content builder matrix field with multiple blocks. Many sections are shared across sites.
When I built the site, it seemed ...
1
vote
1
answer
33
views
Big upgrade completed locally, how to upgrade live?
I have a site that was Craft 3.4 and Commerce 3.x (unsure of exact version).
Locally, I've been spent a big chunk of today updating to the latest versions of everything and making sure all still works ...
0
votes
1
answer
24
views
Redirect control panel access via .htaccess
I have a website that is hosted on a subdomain, let's say: https://subdomain.maindomain.nl.
My craft content is in the maindomain/public_html/subdomain/git-module
To make it work on the subdomain I ...
1
vote
1
answer
23
views
I want to pull content from a field on an entry into a matrix block that is displayed on that entry, is this possible?
I want to pull content from a field on an entry into a matrix block that is displayed on that entry.
I have entries that are shared between multiple sites. I'd like to be able to add a field on these ...
1
vote
1
answer
60
views
How to completely disable entry versioning(drafts) during editing
Obviously I disabled it in the section settings:
I just want to save the entry after making all the changes, but now it's trying to save the revision after each single change
0
votes
0
answers
28
views
Is there a way to expose User edit history in Control Panel (similar to Entries)?
"Users" version should work like "Entries" versioning work
1
vote
1
answer
36
views
It's possible to display "User" menu history like "Entries" menu history on admin dashboard
Or, Is there any way to modify the recent entries widget and display user history in the same widget
1
vote
1
answer
46
views
How to differentiate between draft versions in ModelEvent?
craftcms/cms : 3.6
First create new entry and it store as draft
then i publish this entry
then create a new draft version of this published entry
so how to differentiate this is first draft or second ...
1
vote
1
answer
48
views
Syntax for URL route instead of using url parameter
I'm confused by the syntax for URL routes. Using Craft 3. I'm working with two separate category groups and have urls like this:
site.com/?parameter=123
site.com/abc?parameter=123
site.com/abc/xyz?...
1
vote
1
answer
243
views
How do I solve "Unknown Property – yii\base\UnknownPropertyException Setting unknown property: craft\fields\Assets::branchLimit"
First of all I am new in CraftCms.
I am trying to run the project local which I cloned, so I have a database which I must import to this project. now its giving this error when I finish importing the ...
0
votes
0
answers
37
views
How to list categories only related to enabled entries or disabled child entries
Edit: solved in comments
My entries are set up as a parent > child structure. A single entry can either have children or not have any. If parent has children, the children entries are put in a ...
1
vote
1
answer
19
views
Can't disable entry versioning
I've got a page with:
15+ sites (are used for serving different languages),
a structure with matrix blocks and super table blocks inside them.
It took almost a minute to save an etnry, so I disabled ...
0
votes
0
answers
29
views
Interface "React\Promise\ExtendedPromiseInterface" not found
So I upgraded the page from Craft 2.9 to latest 3.x.x version.
Now I am trying to install a plugin and I get this error - any help?
Cheers
1
vote
2
answers
34
views
Help building a query with related to
I'm trying to create an or query with 2 related fields and 1 title field.
My version so far is this:
$searchQuery->where([
'or',
['relatedTo', 'targetElement' => $ids, 'field' => '...
0
votes
0
answers
60
views
Duplicate entry '2022' for key 'categorygroups_sites.PRIMARY'
I'm trying to get a live site running locally (using DDEV) and having trouble importing the database. The database is an export from the live site (which is running and has been for a short time).
...
0
votes
1
answer
27
views
Site breaking when I call a custom module up on app.php file
My Craft CMS version 3 site is breaking when I boostrap a custom module up on app.php file.
The code looks like this:
<?php
use craft\helpers\App;
return [
'id' => App::env('APP_ID') ?: '...
1
vote
1
answer
245
views
New to CraftCMS and linking to an existing project using DDEV
The business I work for has just acquired another business whose CMS is CraftCMS. So am totally new to CraftCMS and how it operates. At the moment am finding it a steep / challenging learning curve.
...
0
votes
0
answers
37
views
Import Image on Matrixblock via GraphQL Mutation
I'm trying to create an Entry via a GraphQL mutation. The whole Entry consists of one Matrix(handle: siteimportmatrix ) with one Block(handle: importblock ) which has 4 fields one of the fields is an ...
2
votes
1
answer
143
views
How to use ajax call to retrieve data from craft cms entries to use in php application
I'm building a static webpage with php and Javascript. I have setup all my data in craft cms entries. I want to use ajax to retrieve the data from craft and just display it on my webpage. How do I do ...
0
votes
0
answers
36
views
Error when creating new entry! HTTP 404 – Not Found – yii\web\NotFoundHttpException
Any help is appreciated! I just downloaded and setup craft using composer. I went to create my first blog entry, and as soon as I click "New Entry" I get this error. Setup went smoothly and ...
1
vote
1
answer
43
views
Deleting matrix block on front end form
The below code doesn't appear to be working for me, it will delete all other blocks apart from itself. I just need it to delete itself.
trophyOrders is the Matrix field in the user account.
{% set ...
1
vote
1
answer
65
views
Update user matrix field dropdown through module
Appreciate I may be asking for a lot here - I have an existing module that I use to fire events when a stripe order is completed.
I would like to iterate through some User matrix blocks and update a ...
0
votes
0
answers
17
views
Survey Question - Not Seeing Success Message
I am creating a survey for a client but when testing the survey, I am having trouble getting the Success Message or Error Message when complete ("Thank you for taking the survey" or "...
1
vote
2
answers
45
views
Upgrading from Craft 3.7.1 to 3.7.19
I've been working through my long overdue updates.
I'm now trying to go from 3.7.1 to 3.7.19
(note: I stop at increments that the CP Update list shows an "update warning triangle").
The ...
0
votes
0
answers
50
views
Can you host a custom Craft CMS image to Google Cloud Platform
I'm at a standstill trying to deploy my Craft CMS image to Google Cloud Platform and getting 404s. Could anyone be of assistance?
2
votes
1
answer
103
views
Upgrading from 3.49 to Craft 4, Incrementally
We have a site that has been in production for a while and finally have been given the task of upgrading to Craft 4. We are at Craft Pro 3.4.29.1. Can I upgrade the site in stages? i.e. from 3.49 to ...
0
votes
0
answers
116
views
"The file or directory to be published does not exist" - Yii2 AssetManager
Over the course of about 25 minutes, we're seeing 200+ InvalidArgumentException errors all thrown by vendor/yiisoft/yii2/web/AssetManager.php.
For example:
2023-03-25 18:40:36
[{{ REMOTE_ADDR }}][-][...
1
vote
1
answer
30
views
Renaming an Asset in User Account on upload
I am using a miss match of what I have found across SE but I'm not really getting anywhere doing this form my module in Craft 3.
What I would like to achieve:
When a user uploads an asset to a custom ...
1
vote
1
answer
178
views
After upgrade from Craft 3 to 4: frontend error: Array to string conversion
After upgrading from Craft 3 to Craft 4, the backend is accessible but the frontend displays the error:
PHP Warning – yii\base\ErrorException Array to string conversion
And points to many files:
...
2
votes
1
answer
52
views
Registering an element source with EVENT_REGISTER_SOURCES for a specific site ID
Is it possible to register an element source for a specific site ID, while it not appearing in another?
I have a module which is currently registering element sources, however we are now looking to ...
2
votes
1
answer
34
views
Access a CraftCMS 3 site that someone else built?
I'm trying to gain access to a Craft CMS site for a client that someone else built. We have access to the admin panel to edit content but I'm wondering how I would go about gaining access to the site ...
1
vote
1
answer
32
views
How to install Craft Commerce Shopping Feed Pro plugin
I'm attempting to install the Craft Commerce Shopping Feed Pro plugin using the following:
composer require kerosin/craft-google-shopping-feed-pro
But I'm getting the following error:
Could not find a ...
3
votes
1
answer
281
views
What does the triple operator ??? do in this case?
I know what the null coalescing operator (??) does. I have an example here with 3 operators and I am unsure what it does?
Here is an example that I came across in a script I am trying to debug:
{% set ...
1
vote
0
answers
20
views
Merging production version into local environment
My live Craft site was built by another dev a while back just before I joined the company, at the time of launching it I had it setup locally with docker and the most recent site files. Since it has ...
1
vote
2
answers
100
views
Querying Globals from a Custom Field Type gives 502 Bad Gateaway
I'm creating a Custom Field Type whose possible values depend on the Globals. Therefore, I'm querying the Globals from the Custom Field's init():
class CustomField extends Checkboxes
{
public ...
0
votes
1
answer
169
views
Undefined array key "permissions" error after upgrade to Craft4
Hi need some help here.
I recently I tried to upgrade Craftcms from Craft Pro 3.7.55.2 to Craft Pro 4.3.6.1, there is no error in migration, but when I try to edit a user group, I got this error:
[web....
1
vote
0
answers
37
views
Object of class craft\commerce\models\ShippingMethod could not be converted to int Error generating from craft commerce
At a little bit of a loss here, just updated a Craft 3 site and I've started getting an error thrown whenever the cart is accessed.
Relevant updates were:
CraftCMS 3.7.11 -> 3.7.27.2
Craft ...
0
votes
0
answers
22
views
What happened to preferredLocale in craft3
I upgraded to craft 3 from craft 2. My users don't have access to the control panel so I created a plugin where they can select from the front end their preferredLocale to determine which language to ...
0
votes
0
answers
22
views
Issue with custom field plugin - conversion from Craft 2 to 3
I have a custom field I created for Craft 2. It is a usergroup field where it will show a variety of checkboxes where an entry can be apart of multiple usergroups. The plugin has worked fine in ...