All Questions
13,634
questions
0
votes
0
answers
7
views
Http 503 — Service Unavailable error after successful craft 4 installation. Can't even load a hi.txt file in web root
After successfully getting my DB setup and installing Craft through the command line, I'm getting a persistent 503 error on even a simple hi.txt file
https://saltandpepper.recipes/hi.txt
On the admin ...
0
votes
0
answers
10
views
Entry URL from Entries Block in Matrix
I'm having an issue that I can't seem to figure out. I have a Matrix with an Entries block to make a Swiper slideshow with thumbnails. Everything seems to be pulling correctly per slide except two ...
0
votes
1
answer
14
views
Getting column not found when using 'Entry::find()' to find the matching channel entry in custom plugin
We are building a plugin to perform some custom operations with an ERP system.
We created a section for managing the users from ERP. We are able to create new users as channel entries and update them ...
0
votes
0
answers
21
views
100% CPU usage since a few days
so We're having 100 % CPU usage (memory usage is quite normal, load average is high more than 5 or 6) on my Craft 2 production since a few days now. I thought it's a background task but nopes. Thanks ...
0
votes
0
answers
15
views
Craft user error after upgrade to Craft 4
I have an issue after upgrading to Craft 4. It seemed like the upgrade wen't smoothly, however I have an issue where users are unable to view their account settings or create new users.
I get an error,...
1
vote
1
answer
19
views
How to implement Laravel's collection `filter` method inside twig?
How to implement Laravel's collection filter method inside twig?
Laravel:
$collection = collect([1, 2, 3, 4]);
$filtered = $collection->filter(function ($value, $key) {
return $value > 2;
}...
0
votes
0
answers
14
views
Getting GraphQL working with Authorization header
In the docs, the following is written:
Apache strips Authorization headers by default, which can be fixed by enabling CGIPassAuth or adding the following to your .htaccess file:
RewriteCond %{HTTP:...
1
vote
1
answer
32
views
Attach file to Freeform submission
I'm building a form that allows a user the ability to attach their authored assets onto the form submission.
I have a custom module that's hooking into MailerService in Freeform and looking up the ...
1
vote
1
answer
96
views
How to Extend Craft CMS frontend controller?
How to extend craft's front end controllers?
I don't want to use twig.
I like twig but I don't want to use it in craft.
Respect my decision and help me.
Is there a good way to do that?. So I can ...
1
vote
1
answer
21
views
Increment automatically the number field
I'm building a component in which the value of a number should be increased every 2 hours by 0.1.
What would be the best solution for that?
I have a field type number with the value 1200 by default.
...
0
votes
1
answer
20
views
Sort entries by separate related entries count
I am working on a sprig board that filters out Lessons from a structure in Craft.
This screenshot better illustrates this and how it works.
The main table is built using the following:
{# Sets default ...
1
vote
1
answer
21
views
Is it possible to change the order of entries or posts on the homepage?
I need to change the order of the posts / entries on our homepage - is there a way of doing that?
1
vote
0
answers
34
views
Backend: Entry list failes to load
I use Craft Pro CMS 3.7.39 [edit: now updated to Craft Pro CMS 3.7.42] in headless mode. Worked fine for some weeks now - but without configuration or code change some of many sections entry lists ...
1
vote
0
answers
22
views
CraftCMS Commerce order by most sold products
I am currently working on a project where I have to sort products based on their times being sold.
Unfortunately I could not find anything related to this functionality.
Where do I start to implement ...
1
vote
0
answers
28
views
Dropdown field value printing cause additional DB queries in craft CMS 3.7
I am fetching an entry with drop-down values and When I print the entry the values are in the entry object. When I try to print the value like entry.dropdown.value it causes additional DB queries to ...
2
votes
1
answer
23
views
Redirect to entry based on password
I don't know if there even is a way to do this using Craft CMS:
I am looking for some sort of a password protected redirect. domain.com should show a password mask that accepts multiple different ...
1
vote
0
answers
24
views
All logins fail on Craft CMS 3 after code redeploy and database restore
Background:
AWS deployed Craft site.
I pushed an update to the php version (7.0.32 to 8.0x) the container was running on along with an upgrade to Craft (Craft Pro 3.5.15.1 to 3.7.42) and several ...
1
vote
0
answers
13
views
Craft 2 White Screen - All Queries Not Running
I have a CraftCMS 2 template with a JavaScript setTimeout for auto refresh, and quite randomly, the page will only display a white page.
Dev mode is enabled, and, through the browser's inspector, in ...
0
votes
1
answer
39
views
Postgres SSL PDO config for config/db.php
Struggling to configure this correctly and cleanly. When I upgrade to latest 3.x Craft on staging, Craft can no longer connect to the Postgres DB, which uses SSL. Have had success up until CraftCMS ...
1
vote
1
answer
22
views
Array manipulation
I have two arrays of entires.
One for featured articles and another for the rest.
{% set featuredArticles = entry.featuredArticles.article.all() %}
{% set articles = craft.entries().section('...
0
votes
0
answers
10
views
Redactor outputs at top of page
im coming up against somthing kinda odd.
If I use redactor to put a link on a page it adds part of that link to the top of the document like it is being output there.
I have wrote this type of code ...
0
votes
0
answers
24
views
Programatically add new neo blocks without overwriting manually made one
I am trying to programatiacally add two new neo blocks to an entry. It works, but it overwrites any manual added blocks that already exists in that entry.
For context:
I have an entry with three neo ...
0
votes
0
answers
12
views
Expiry Date not being saved
we are trying to take advantage of the expiry date of Entries in Craft, but have observed that this field is not being saved into the database. Any ideas why this isn't being saved?
Craft CMS 3.7.39
1
vote
1
answer
115
views
Craft 4: using the new laravel collections and related methods (in a performant way)
I am working on a website for a radio that publishes its programs as podcasts with episodes. Each of the 30 or so programs potentially has a lot of episodes.
Each entry in the episodes channel has a ...
1
vote
1
answer
17
views
Catching queue fail event
I have a queue that runs from a cron tab and I'd like to know immediately if it ever fails. Is there an event that fires or any other kind of way to hook into the queue behavior in a module when it ...
1
vote
1
answer
82
views
Upgrade to Craft 4
Anyone succeeded in upgrading from Craft 3 to Craft 4 ?
Before staging the changes on our dev server, I tried it locally without success. Although it seems pretty strait forward, I updated all plugins ...
0
votes
0
answers
28
views
Why is my database stuck at the 'Creating sort index' query?
So I imported the production database locally and it is getting stuck at the 'creating sort index' stage of the query when I try to log in to the CMS.
This is the Server Process table from SequelAce ...
1
vote
1
answer
23
views
Update Search Index on Entry create and update
I have a multiselect drop-down for age group and I have set "Use this field’s values as search keywords" check box checked.
when I create a new entry or update existing entry . we are not ...
2
votes
1
answer
42
views
How to run custom module controller actions from console?
I have built a custom module with some custom controller actions - some of which I would like to run via console, but I am not sure what the path/command should be for running these actions?
In my ...
0
votes
0
answers
11
views
Craft CMS - Free Form builder plugin create form issue
I trying to create form with Free Form builder https://plugins.craftcms.com/freeform and when I submit it just disappear, nothing happens ( licence is activated ). Any idea?
1
vote
0
answers
26
views
Lightbox gallery
Maybe someone can give any tips how to make lightbox gallery for CraftCMS?
{% set gallery = entry.gallery.all() %}
<div class="columns is-multiline is-mobile py-3">
{% for gallery in ...
0
votes
0
answers
25
views
How do I customize the searchScore?
In my article listing page, I have a search function. I define the article query like so:
{% set orderByRule = 'postDate DESC' %} {# Default order. #}
{% if searchQuery is not null %}
{% set ...
0
votes
0
answers
30
views
Order related entries by the amount they have in common
I am trying to build a function that creates a list of related entries based on a few criteria. This is no issue since this can be easily achieved by using relatedTo.
The problem I am facing is, I can'...
1
vote
1
answer
17
views
Escaping quotes of an entry string used inside a script tag
How can I display an entry string, with included special characters (like single and double quotes) , inside a script tag without translating these special characters into html entities but escaping ...
2
votes
1
answer
212
views
DB CPU running at 100%, Pages Never Load, Moving from MySQL to MariaDB
I've been running a somewhat busy database (~800Mb) in GCP SQL. Due to the cost of it I've been working on migrating to a custom server running MariaDB. Which I'd heard could be much more cost ...
1
vote
1
answer
46
views
Craft CMS admin pages return ERR_EMPTY_RESPONSE locally
Craft CMS admin pages don't load. Sometimes some pages like starting admin page or settings load, or load after refresh.
Chrome browser shows ERR_EMPTY_RESPONSE error.
Here is video.
PHP version 7....
1
vote
1
answer
24
views
DevMode set to true, but doesn't appear to work locally
I'm having trouble getting DevMode to work locally. I'm using nitro.
I have this set in my .env file...
ENVIRONMENT=dev
... and my general.php file looks like...
<?php
/**
* General Configuration
...
0
votes
0
answers
29
views
Craft creating over 250.000 cache files
My Craft CMS 3.7.38 is creating over 250.000 almost identical cache files inside the /storage/runtime/cache/-folder. Because the website isn't even a frequently used big platform, I have no idea why ...
0
votes
0
answers
23
views
How to query relations within Supertable field via GraphQL
I have two Entry types: Albums and Songs. On the Albums entry type, I have a SuperTable field (called tracklist) where you can add tracks and select one Song entry per row.
On the song page, I'd like ...
1
vote
2
answers
33
views
How to get user info in a custom plugin task?
I've been trying to get the user id when running a task to save it on a table but cannot find a way to get it not even the user info.
Using Craft::$app->getUser() or Craft::$app->user I get:
[&...
0
votes
0
answers
25
views
Problem with "save and continue editing"
i have some weird behaviour in my craft installation. It came after some update not sure when.
The problem is when i use "save and continue editing" button (or shortcode) then i'm redirected ...
0
votes
0
answers
16
views
Output email address from Freeform as query string
I need to include the email input from a form submission in a query added to the return URL. ie /return?email=myemail@domain.com
But the @ symbol is converted to an HTML entity ie /return?email=...
0
votes
0
answers
15
views
Freeform - Prepopulate from entry
Good Afternoon,
Is it possible to have a freeform form render and then be prepopulated with data from an entry?
I would like to create an UPDATE form for existing entries
Edit: Ive maanaged to do ...
0
votes
0
answers
17
views
How to upload file via GraphQL
I am unable to find any information about how to upload a file via GraphQL. Any help would be appreciated. This is my mutation at the moment.
mutation saveContactForm($slug: String, $title: String, $...
0
votes
0
answers
33
views
Better Performance: Entries Versus Matrix Blocks
I've been struggling with the best way to architect a new content type for some time now and wondered if anyone had any advice.
Here's the desired end goal: to be able to record granular pieces of ...
1
vote
0
answers
25
views
How do you access the Label of a Table field column with a Type of Dropdown?
How do you access the Label of a Table field column with a Type of Dropdown?
I have a Table field in a Matrix block and one of the column types is a Dropdown. When I use the {{ row.handle }} syntax ...
1
vote
1
answer
15
views
Outputting Opening Hours in SEOmatic
I could use some help outputting opening hours from SEOmatic's Site Settings/Identity. The docs aren't clear on this, and the example at https://github.com/nystudio107/craft-seomatic/issues/843 doesn'...
2
votes
1
answer
29
views
Ensure @web alias is explicitly overridden warning on system check
Ensure @web alias is explicitly overridden
^^^I am not sure why this warning shows up in Craft's system report.
I already have defined @web alias in config/general.php per instructions on craft's ...
1
vote
1
answer
42
views
Get entries with a specific post date
I'm having absolute brain fog right now.
I'm trying to show a list of entries with a given postDate
{% set startDate = startDate ?? now|date('Y-m-d') %}
craft.entries
.section(['jobs', '...
0
votes
1
answer
43
views
GraphQL - Categories with entries
Is it possible to get categories with related entries with one graphQL query?
I have the following query:
query MyQuery {
categories(relatedToEntries: {section: "entryType"}) {
id
...