Questions tagged [craft3]

For use with questions relating to the Craft 3 version of Craft CMS, including the Beta and RC releases.

Filter by
Sorted by
Tagged with
2
votes
2answers
1k views

From a Twig template, how to retrieve the content of a HTTP header in the current request?

I would like to detect if a header in the current request is present and obtain its value, directly within a Twig template. I know that craft.app.request gives access to a few variables like isAjax ...
1
vote
1answer
828 views

Craft 3: admin is showing "500 Internal Server Error" (apache) after fresh install

Just successfully installed a fresh copy of Craft CMS via web browser method under: http://kultursprung.org Frontend is visible but the admin is showing raw Apache error 500 after fresh install: http:...
1
vote
1answer
69 views

Search return wrong result with special character like @#! in Craft 3

I have implemented search in Craft 3, but it returns wrong result when I enter some special characters like @#!. Is there a way to prevent it?
1
vote
1answer
750 views

ERROR 1370 (42000) alter routine command denied to user

I am trying to upload my DB using MySQL Workbench but am getting this error: ERROR 1370 (42000) at line 4534: alter routine command denied to user 'detectalocal'@'%' for routine 'detectalocal....
0
votes
1answer
61 views

How do I upgrade the MYSQL database from Craft 2 to Craft 3 on GoDaddy

How do I upgrade my MySQL DB for a Craft 2 site to Craft 3. I don't have access to the SSH server or use of Composer, so I have to move files via FTP and do everything manually. My client is on ...
1
vote
1answer
312 views

Craft 3: Searching within back-end & front-end isn't giving all entries/results

Searching within Control Panel as well as the front-end is not going through all entries. When I try searching in the Content tab I see the pages are listed but when I try to search for the entry it ...
1
vote
0answers
8 views

GraphQL next does not accept 'relatedToCategories'

I'm trying to get the next project in the "projects" section but with the same category. So because I can't do it in one query (the value of my category is in the result), I do another query ...
1
vote
1answer
24 views

How does Craft CMS gets data from a 3rd part API?

I have an event page for viewing movies showtime and i want to connect to a 3rd party api to get the movie's info ( show time, cinema name,...etc ) how to do it? can i do this without having to create ...
1
vote
1answer
102 views

Updating private repo plugins from admin?

Is it possible to update private repo plugins from the admin at all? Would love that functionality, especially for smaller projects that are installed where there's no CLI access.
1
vote
1answer
190 views

Adding 301 permanent redirections in Craft CMS

I am not able to redirect any dead page. Although I have added the redirection but it is not getting reflected. Please help.
1
vote
1answer
28 views

How to make "Wheel Form" fields in JSON format using API

I've installed a "wheel form" plugin on headless CMS. Now how do I make this form JSON format using API or write PHP code for display on the frontend?
1
vote
1answer
19 views

Craft CMS admin intermittent internal server errors

I'm getting intermittent Internal server errors in Craft admin. This has happened out of the blue on an active site. Craft pro 3.041 phperrors.log: PHP Notice: Undefined index: constraint_name in /...
1
vote
1answer
246 views

"Could not find composer.json file" error in CraftCMS 3

I recently updated my CraftCMS 3 with the help of Composer. When I try to install a plugin with the plugin store, I get an error saying that Craft couldn't find my composer.json file. He proposes me ...
1
vote
1answer
1k views

craftcms/vue-asset Related Error on Craft and Plugin Update

When updating my plugins or craft I get the following error... Error: The "https://composer.craftcms.com/p/nystudio107/craft-imageoptimize-imgix/...
2
votes
1answer
332 views

How can I debug `craft\web\User::_validateUserAgentAndIp()` warnings

On a production site, we're seeing a ton of the following warning in our web.log files for (seemingly) every request, creating a ton of noise in the logs and making it hard to spot "real" issues: &...
1
vote
1answer
16 views

How do I add an import page to Craft CMS

I need an to add an import page to a craft CMS. But although I have experience as a full stack programmer I don't see how to add a page to the menu of the CMS. How is this done? Can anyone tell me? I ...
1
vote
2answers
635 views

query on Super Table field's date field

I have a section (events) with a Super Table field that has a date field. I am looking for a way to make a request to have the events superior to now. I cannot find how to do it. The event have ...
1
vote
1answer
31 views

How to Add “Enabled Globally” in each entry page?

I want to Add "Enabled Globally" in each entry page So when users create a new page, it will set English as the default content (apply to other languages), then the user can edit on specific ...
1
vote
1answer
20 views

Check for existing jobs in queue

Is it possible in code to search for a job/list out all jobs? I have built a plugin that scans an external API and I want to scan on an interval as well as allow the user to fire off a manual scan. I ...
2
votes
2answers
28 views

How to get multiple image array using API or PHP query

This is a single asset field to upload multiple images so how to get all images using the query. I have three images here but I am getting one image using this code $home = \craft\elements\Entry::...
0
votes
0answers
26 views

Contact Form not sending email with most recent version of template

Platform: Craft Solo 3.7.21 P&T Contact Form plug in 2.2.7 Redactor 2.8.8 I am trying to use the Contact Form plugin and having problems when using the latest version of the API. I have an old ...
0
votes
0answers
9 views

Custom Plugin JS load order/breaking in Control Panel

We have site that has a small custom plugin. One of the things this custom plugin does is run a small bit of JS that allows the 'Importable' plugin to work on table fields within a matrix. The JS that ...
2
votes
1answer
43 views

How to make custom element types restorable?

In Craft CMS 3, custom element types support soft-deletion out of the box. But once soft-deleted, there is now way to restore elements that are now listed in the Trashed status, the only available ...
2
votes
1answer
36 views

Free Shipping toggle switch in product editor doesn't work

Hi in the product editor of Craft Commerce by default there is a toggle switch for Free Shipping on the right side column. I have the base rate set up as a standard flat rate charge but wanted to know ...
1
vote
1answer
64 views

Craft Setup 3.6.5.1 with MYSQL with SSL version 5.7.29

I'm trying to install Craft version 3.6.5.1 with MYSQL version 5.7.29 from Azure. While setup it fails with the following error Testing database credentials ... failed: SQLSTATE[HY000] [9002] SSL ...
1
vote
1answer
53 views

DOM hash url in entry slug

I try to set the slug of an entry to a url using a hash. https://url.spec.whatwg.org/#dom-url-hash However it seems not possible by default, craftcms changes the hash to a dash. I need that as ...
1
vote
1answer
69 views

How to auto enable a plugin after install?

I am developing a plugin for craft 3 and the plugin just got published to the store. I can browse through the store and install the plugin but it stays disabled. The user will have to goto Settings -&...
1
vote
1answer
13 views

Craft Commerce Checkout: How to prevent payment link from bypassing shipping section in nav-checkout

I'm using checkout.twig in the CraftCMS shop checkout examples templates. As the user proceeds though the checkout process, this nav strip appears at the top of each page and marks their progress. The ...
0
votes
0answers
11 views

sourceSnapshot not populated in lineItem adjustment

I'm querying the order, and from the order I'm looping through the line items returned from getLineItems(). When I then dump the line item, calling getAdjustments(), the sourceSnapshot never seems to ...
2
votes
2answers
36 views

How to reliably determine if an entry is being duplicated?

On a Craft 3.7 site, I need to make some changes when duplicating an element: set the dateCreated, dateUpdate & postDate to the current date ensure the entry is disabled clear the value of an ...
2
votes
1answer
119 views

How to define table attribute in the record file

Following code is working on Craft 2: class My_TableRecord extends BaseRecord { public function getTableName() { return 'my_table'; } protected function defineAttributes() { return [ ...
0
votes
1answer
18 views

Discord Link dead? [closed]

Anyone have the correct invite link for discord? The one on the craft site is invalid. Here is the one on the website: https://discord.com/invite/uuDFCTX
0
votes
0answers
23 views

500 errors, fix them then lose plugins and site won't load

I've been going around in circles. Moved a site yesterday, all seemed OK. Went to install a plugin this evening, and got a fatal error (I had been getting the same error when transferring the site, ...
1
vote
1answer
957 views

Checking which version of Craft CMS a site is using

I've been asked to look at Craft CMS site where my would-be client has been ghosted by his previous developer. I have no handover information and only FTP and phpmyadmin access presently. Looking ...
1
vote
1answer
116 views

Get entry by language in a module

I'm trying to get some auto translating done in a craft module. In order to do this I need to get the entry of another language in a save event. Is it possible to get this by language? Event::on( ...
0
votes
0answers
32 views

Guest Entries form freezing site after Craft update

I'm using this answer along with the Guest Entries plugin to allow guest users to edit entries via a frontend form. It was working beautifully before, and after updating Craft it's now taking ages and ...
0
votes
1answer
33 views

How to bind JavaScript events to entry form fields in the control panel

When adding an entry, there is a field called resource id, I want to build a front end event on this field, after the value input or changed, trigger ajax to call an external api to check whether the ...
0
votes
0answers
19 views

Need help combining an item with free shipping and an item with paid for shipping

Hi I'm going around in circles with Craft Commerce shipping functionality and I don't mind saying I'm pretty confused. This should, however, be fairly simple to solve... hopefully. My website has a ...
1
vote
1answer
32 views

How to create a follow system "button" for "Event" entries?

First of all, Please excuse my English Q: I have a section called "Events" And and has some entries On the front-end i have a list of card "Events" and each card has a "...
0
votes
0answers
24 views

internal server error when creating new field

whenever i try to save a new field I get an internal server error in the backend of craft 3. This happens whenever i want to create or modify a field that has an input like date, plain text, reactor......
1
vote
1answer
22 views

What's the attribute of a Matrix field to add error message

I try to validate some fields before saving the entry, if the field is invalid, prevent the entry from saving and return the error message, I'm doing it via Element::EVENT_BEFORE_SAVE event. It works ...
1
vote
1answer
13 views

Composer Unexpected end of file on new plugin

I'm making a new Plugin for CraftCMS, it works fine locally but when I call the services class on our staging server it throws a Syntax Error, Unexpected end of file. I've installed them both through ...
1
vote
1answer
10 views

Settings for redactor's plugin Special characters

Is there a way to adjust Special Characters plugin's list of characters in Redactor settings (or in other config file)? I can make the changes I need (reduce plugins menu, add new characters) directly ...
1
vote
1answer
20 views

how to write db-commands on custom table (PHP syntax) inside twig file?

if i have a custom table (ct_table) and i have to use MySQLi commands on it using the PHP syntax, it won't work if i put the PHP snippets inside a twig file. So are there any tools or official methods ...
1
vote
1answer
33 views

Do i need a [ Craft PRO ] to create accounts/User management for my LMS website?

I'm still a new to Craft and trying to make an LMS website when i started to search about the [ Sign up/Sign in ] i read that the official docs : https://craftcms.com/knowledge-base/front-end-user-...
1
vote
1answer
12 views

Limit elementSelectField to specific sections

How do I limit this elementSelectField to only allow entries within a certain section? {{ forms.elementSelectField({ label: 'Blog post', name: 'blogpost', elementType: 'craft\\elements\\Entry', ...
1
vote
1answer
293 views

How to configure Google Cloud Storage in Craft v3?

I'm doing the Craft 3 upgrade and I can't figure out how to connect our Google Cloud Storage. Back with Craft 2 I used a Google Access Key and Access Secret Key. Now I am asked for a Project ID and ...
1
vote
1answer
27 views

Redirect to Craft CMS Website Results in 403 "Request forbidden by administrative rules"

My Setup I added a stripe checkout redirect from my craft website using Stripe Checkout so I can accept payments from customers using payments handled by stripe. In simple, I use AJAX on the frontend ...
1
vote
1answer
97 views

Weird issue with craft/setup command

I have been trying to install Craft CMS on Windows. I tried composer: composer create-project craftcms/craft d:\temp\craft After that when I try to craft setup there is a loop on the console which ...
1
vote
1answer
351 views

PHP Core Warning – yii\base\ErrorException Module 'newrelic' already loaded craft 3

I upgraded Craft 2 to Craft 3.3. Sometimes I am getting an error in admin like below when saving entries or taking some URL. PHP Core Warning – yii\base\ErrorException Module 'newrelic' already ...

1
2 3 4 5
35