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
3
votes
4answers
785 views

Tons of Deleting Stale Template caches

My task queue (is that what it's called?) is filled with literally hundreds of "Deleting Stale Template Caches" and every day there seem to be new ones. Along there are also resaving entries tasks and ...
1
vote
2answers
26 views

HTTP 503 – Service Unavailable error

I've cloned a Craft 3 repo that was created by another developer and I'm trying to get it running on my local server but I get HTTP 503 – Service Unavailable – craft\web\...
2
votes
1answer
490 views

“Failed to instantiate component or class” when calling Craft module

I created a module with the pluginfactory generator. The module is used for generating a zip file with all the files belonging to a project. In the composer.json file, I added the following: "...
4
votes
3answers
603 views

How do I “register” a service in a Craft 3 plugin?

In Craft 2, services were auto-loaded when using the craft()->plugin_serviceName->myMethodName() signature, but it seems like there's a catch in Craft 3, when using the new MyPlugin::getInstance(...
1
vote
2answers
28 views

Generating Webp Images - Webp Installed but not Generating Images

I'm struggling to generate webp images on my forge server. Here is my process in Craft 3. ssh in to the server (forge) Install wepb sudo apt-get install webp Check it is installed and getting piacked ...
0
votes
0answers
14 views

Form structure using Matrix and Super Table

I'm quite new to Craft3, and I have to create a complex form which contains selection of product series and setting up the quantities of the products from that series, as well as quantities of ...
1
vote
1answer
32 views

Craft 3.1 no longer updates all entries on section save - workaround?

Craft 3.1 seems to have removed the functionality where if a section is saved, all entries in that section are re-saved. This has broken a bunch of functionality that relies on this on a site I've ...
1
vote
0answers
21 views

Cannot get asset from custom user field, with no-admin account

I would like to get a file of custom user field, which is "asset", and provide a link to the file for the user. However, the asset file cannot be gotten. The length of the asset field is zero. In ...
1
vote
0answers
17 views

Craft Table/Tabular static entry input field

Is there a way to set up a Craft CMS entry field to have a table with predefined rows and columns? I have tried with the native Craft Table field, but it allows users to add rows or edit default ...
1
vote
1answer
159 views

Craft reCAPTCHA Plugin (Matt West)

Has anyone tried using the Craft reCAPTCHA plugin from Matt West? The issue I am experiencing is that if a Contact Form is submitted without ticking the reCAPTCHA widget, the form does not submit - ...
1
vote
2answers
30 views

Is there a way to make conditional input fields in Craft CMS?

I'd like to use conditional fields in my CMS instance. I found an old plugin called Reasons. I'm not sure it's compatible with Craft 3, so I'm looking for a workaround.
1
vote
1answer
7 views

GraphQL private schema returning public schema scope

I am setting up GraphQL on my Craft project, v3.3.16.3 I have a public schema exposing a public entry type, and a private schema exposing a private entry type. When I switch between them in the ...
0
votes
0answers
22 views

Craft and Algolia

I am trying to implement Algolia into Craft 3 and am having a few headaches. I am using scout to update my indexes which seems to be working as expected and am using the instantsearch.js ...
2
votes
1answer
38 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: &...
0
votes
0answers
20 views

ElementAPI: How to trigger the Custom service php file when a endpoint is loaded

I am Using Craft 3.3.11 version I have a php file in plugin/elementapi/src/services/EapiServices.php and the same file within vendor/craftcms/element-api/src/services/EapiServices.php When ...
1
vote
1answer
60 views

Securing a Generated PDF

I recently purchased the Digital Download plugin for Craft. I'm wanting to secure a PDF download generated by another plugin called Enupal Snapshot. Reviewing the Digital Download documentation I'm ...
1
vote
0answers
26 views

Craft 3 memcached session storage in load balanced environment

I'm getting the good old session expired popup every minute in the admin panel which is odd given that memcached should be properly configured: php.ini session.auto_start = 0 session.save_handler=...
1
vote
1answer
17 views

Delete entries from database

I believe I made a mistake by creating about 15,000 entries in a Structure section. It has caused a lot of problems and so I decided to start again with a Channel section instead. I tried deleting the ...
0
votes
0answers
25 views

How to get previous and next entry using the native GraphQL API?

How do I turn these Craft queries into a GraphQL one? // entry.twig entry.getPrev({ section: "contentHub" }) entry.getNext({ section: "contentHub" }) I want to get the previous and next entry using ...
1
vote
1answer
31 views

Template not found error when template file does exist

I am getting a Template not found error. Template not found error: case-studies/_category However the template does exist (see screenshot). I have tried clearing the template cache but still the ...
1
vote
0answers
24 views

Using multiple elementTypes in Element API

I am currently trying to create an autocomplete search with the element-api. I need results from two different elementTypes: Product::class Entry::class How do I get results out of both elementTypes ...
0
votes
0answers
10 views

Cart total before shipping and tax (but with discounts)?

Wanting to check this out but it appears that there is no property or method to get a total of all lineItems in a cart plus any discounts (so without any tax or shipping (ie. other adjustments)). It ...
2
votes
1answer
19 views

Pass params to transform function of Transformer class in split Transformer class

I have transformer like down below in the element API. 'transformer' => 'MyTransformerClassName', Or 'transformer' => new MyTransformerClassName(), I am going to pass a param like $user ...
0
votes
0answers
24 views

Set redirect URL according to some conditions

I implemented an API and in one controller I need to open a webview for the user to enter some data from another site and then come back to my site. I am having trouble setting the redirect URL since ...
1
vote
1answer
26 views

Craft 3 on new MAMP Pro 5 installation: “iconv(): Unknown error (22)” problem in /vendor/twig/twig/src/Extension/CoreExtension.php

I have been fighting with a Craft 3 upgrade of a Craft 2 site on a local dev environment for a while now, though much of the time the problems turns out to be MAMP Pro 5 and/or FastCGI PHP. I'm not ...
1
vote
1answer
15 views

Verbb Navigation Plugin Assistance needed

Good morning and thank you in advance. I have one Verbb navigation called main. Underneath that, I have three nodes (see image). Under those nodes are regular links. I want my template to pull only ...
1
vote
1answer
29 views

Fields Missing. Gone from Database as Well as Control Panel

Recently the organization I work for started a podcast and wanted to add a section on the site where people could find some information about the podcast, some links to subscribe, and more details ...
4
votes
7answers
751 views

Invalid plugin: No plugin exists with the handle - Craft 3

I had an issue with my site running Craft 3.1.15 where I wasn't able to update the site to the most recent 3.1.16, and also wasn't able to install any plugins. Every plugin I tried would throw this ...
0
votes
0answers
17 views

Save and log in a user from event callback

I'm trying to build a plugin wherein after a user is created via the normal means via a front end template, the user is immediately logged in. My module is watching for the after save event on ...
0
votes
0answers
17 views

Craft using over 1000mb of memory: HTML Purifier and Yii db

I've been getting warnings from my host lately that my Craft website is using around 1000mb of memory and they've had to kill processes (my limit is 512mb). I'm curious, is this normal? Seems to be ...
1
vote
1answer
19 views

Replace # with entry.title

Good morning and thank you in advance. How can I replace '#' with the entry.title. I have tried everything and I keep getting hash errors. Current code is this: <h3>{{ wordBoldTitle|replace({'#'...
2
votes
2answers
72 views

Craft CMS/Feed Me slow performance

I am wondering if I have structured my data badly and was hoping someone could advise on an alternative. Essentially I have a structure with two types, a catalogue and the catalogues children. Some ...
0
votes
0answers
10 views

Set the redirect url for a request from a plugin

I implemented an API for my Craft 2 site, One of the requests requires me to open a webview where the user can fill in some forms. What happens is that he enters some info from the app that will be ...
1
vote
1answer
13 views

ERROR: relation “info” does not exist

Be warned this is sort of Docker related question too. I try to build local development environment using Docker (nginx 1.16.1 + postgresql 12.1.0). I've came up to a point where I run the setup ...
1
vote
1answer
17 views

Hide navigation from one entry but not others

I am looking to hide the main navigation for entries that have the lightswitch 'showMainNavigation' disabled. The problem I am facing is when I disable for one entry, the navigation is hidden for all ...
1
vote
1answer
32 views

Server's IP in URLs in cached templates

I'm running Craft CMS 3.3.11 on an EC2 machine with Apache and Load Balancer. After upgrading to Craft 3, I'm having issues with caching. I use relative paths to resources/assets in my templates (...
1
vote
1answer
12 views

Craft 3 plugin - how to update entry with field of Entries type

Using PHP, I want to update a field of Entries type of an existing entry. Fields of type Text and Number will update with the following code: $entry = Entry::find()->id($entryId)->one(); $...
2
votes
1answer
200 views

Craft 3 attachment email

I need to add an "attachment" to an email sent by Craft CMS 3. I used a custom "Module" for this with a "Model", "Service", "Record" and "Controller" I did some research but did not find any clear ...
1
vote
1answer
18 views

Plugin (SyncDB) issue breaking site and unable to do anything

I was in the process of setting up the UNION co SyncDB plugin and must have misconfigured something as I now get the following error: "Undefined index: skipTables" and seem to be completely locked out ...
2
votes
0answers
38 views

How to wire html template to twig extension? (Mainly `Twig\Error\SyntaxError: Unknown filter Error`)

I am going to use a Twig filter function by using Twig extension in my HTML file. I followed this guide. https://cameronspear.com/craft-cms-twig-filter-extension/ But when I run <p>{{ 123 | ...
1
vote
1answer
29 views

How to build a web page using different sections created in craft

I am a beginner in Craft. I have a Craft website. There is an HTML design with me. From admin, I divided the HTML into sections and created entries based on that. All the coding related to each ...
1
vote
1answer
52 views

How to debug or log some special variables in Craft CMS? (Especially in a controller)

I am going to debug the variables in controller files. But I couldn't figure out how I can debug it and show the values into front-end site or in log files. Do you have any ideas about this? What ...
1
vote
1answer
25 views

Related Entries Relationships

I am building a site where I have users, companies and content. Currently my users are standard Craft users, and my companies and content are entries within a channel. I have a field in my content ...
1
vote
1answer
26 views

Custom Token Authentication with Craft 3 Login Form

I am building token auth system in Craft 3. https://docs.craftcms.com/v3/dev/examples/login-form.html I used this Login Form. Now I am going to create my own token and save it in user profile. First ...
0
votes
0answers
33 views

Control panel - Entry indexes very slow

Craft CMS 3.3.15 PHP 7.1.3 MySQL 5.5.42 I have a structure with 360 entries. Right now in the CP it takes 3.5 - 10 seconds to load the first 50. And another 3.5 - 10 seconds for every additional ...
1
vote
1answer
16 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....
1
vote
1answer
12 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?
0
votes
0answers
10 views

Exception Running garbage collection

When I run ./craft gc I get the following error: Running garbage collection ... Exception 'yii\base\InvalidConfigException' with message 'Invalid section ID: 30' The Section ID of 30 that it's ...
1
vote
0answers
28 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 ...
0
votes
0answers
10 views

Is it possible to build its own html form template and loop on tabs/fields with form-builder-3 plugin?

Is it possible to build its own html form template and loop on tabs/fields ? Instead of using this : {{ craft.fb.form(form) }} I'd like to add disabled attribute by default on my submit button. And I'...