Questions tagged [craft4]
The craft4 tag has no usage guidance.
153
questions
0
votes
0
answers
11
views
Error on plugin settings page: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
I've installed the latest CraftCMS version via composer.
When I'm visiting the plugins settings page (/web/admin/settings/plugins), I get the following error message:
preg_replace(): Passing null to ...
0
votes
1
answer
23
views
Migration failed - table already exists
I'm stuck in a "migration" that is trying to install a table which it clearly didn't check for (because yes, it is quite already there.)
When I remove the table and allow the migration to go ...
4
votes
2
answers
330
views
Craft 4 upgrade. Entry throwing 'craft\models\EntryDraft doesn’t exist' error in admin
After upgrading to Craft 4 a few entries are throwing this error in the admin (Locally):
craft\models\EntryDraft doesn’t exist or doesn’t extend/implement craft\base\ElementInterface
Not all do this ...
0
votes
1
answer
13
views
How to call and print only Event Types of Event Plugin
How to call and print only Event Types (title and handle of event types) of Event Plugin -> https://verbb.io/craft-plugins/events/features
1
vote
0
answers
18
views
how to add an if to open an external link in the menu
I have a code that I am using to make the menu I created in Craft CMS work. In my menu, I have direct and indirect links. and I also have a child option that uses an EXTERNAL link. In other words, the ...
0
votes
0
answers
17
views
como adicionar um if para abrir um link external no menu [duplicate]
eu tenho um codigo que estou utilizando para que o menu que criei no Craft CMS funcione. No meu menu, possuo links diretos e indiretos. e tenho também uma opção de filho que usa um link EXTERNO. ou ...
1
vote
1
answer
32
views
Craft 4 DB connection works in WEB context but not from Craft's console command
We just completed an upgrade from Craft 3 to 4 (latest version) and now all web requests (FE+CP) work, but not the console commands, it can not connect to the database
./craft users/list-admins
...
1
vote
1
answer
38
views
Money field with dynamic currency selection
I'm working on a multi-lingual site and we need to output costs for products. This is NOT a Craft Commerce site however. I need to show different costs per site depending on the location and different ...
1
vote
1
answer
28
views
Omit specific URLs from the sitemap
I want to exclude certain URLs from the sitemap, depending on the custom field settings in their corresponding entries.
I'm using SEO Matic plugin in craft4
1
vote
3
answers
63
views
Debug Toolbar Not Displaying on frontend
I just updated a site to Craft 4 and the debug toolbar no longer shows on the frontend, but does show in the CP. Have not had this issue with other sites that were updated.
Any ideas?
0
votes
1
answer
44
views
Transfering content from my local docker environment to production
For the second time, I've created a website with CraftCms. This time, I used my windows computer to setup the project but I had to use docker. Fyi, I'm not experienced with docker, but I was ...
1
vote
1
answer
90
views
Is it possible to use static terms inside Formie email notification?
This is my first time using formie and it looks really nice. Thank you for the plugin.
I just have an issue with translations in notification. So here is some context :
I have a form with static terms ...
1
vote
1
answer
163
views
Prepopulating image fields - Formie Plugin on Craft 4
I have a front end entry form for users to update their entry. It's built using the Formie plugin. I need the fields to prepopulate with the current entry content. According to the Formie docs fields ...
0
votes
0
answers
14
views
Setting title in Instant Analytics GA4
I’ve installed Instant Analytics GA4 (https://nystudio107.com/docs/instant-analytics-ga4/)
The default title is the template (which is a bizarre default IMO) as a result all of my analytics are ...
0
votes
0
answers
19
views
I get a 404 not found when going to my site url, but content will show when navigation to url/craftfolder/web
I've made for the second time a craftCMS website. But is goes wrong at the deployment.
After many times of trying, I got it kinda working when going to siteurl/craftfolder/web.
In that case the ...
1
vote
2
answers
179
views
Craft 4, CKEditor 5, image resizeOptions not showing in image toolbar
I'm experimenting with all the CKEditor 5 config options and I like how the docs have the image resize (https://ckeditor.com/docs/ckeditor5/latest/features/images/images-overview.html#image-contextual-...
1
vote
1
answer
37
views
Create section 'landing page' with 'two column block'
I'm very new to Craft 4.
I have a matrix 'Landing Page Blocks'
I've created 2 Block Types: Hero Block and Two Column Block
Within the 2 column Block I need a left and right content block
Within the ...
1
vote
1
answer
37
views
Image Editor: Remove "focal point" and "custom"
Is there a way to remove "focal point" and "custom" options from the image editor?
Custom ratios are documented here: https://craftcms.com/docs/4.x/config/general.html#image-...
1
vote
1
answer
34
views
Calling a Function From Private Plugin
Writing my first plugin. Scaffolded with Generator and is active (appearing in admin). This is where most tutorials leave you on your own so hoping to get some help calling a simple function in my ...
1
vote
1
answer
28
views
Sort articles by seq() value
Im trying to create a view for most viewed articles. I tried with entryCount plugin as recommended here
but unfortunately, when you have more than 500 articles in the last 3 weeks that I'm checking, ...
1
vote
1
answer
41
views
Image path is broken after updating site from Craft version 3 to 4
I am currently in the process of upgrading my site from 3 to 4. My craft CMS version is 4.4.16.1
None of my images are loading in the site after performing update. Our images are stored in AWS.
Upon ...
2
votes
1
answer
25
views
Get list of user logins
I would like to get a list of every login of a user. I know I can get a certain user with craft.users() but as far as I have seen, I get data for lastLoginDate only.
Is there a way to get a complete ...
1
vote
1
answer
22
views
Alias not being resolved directly within an attribute in Twig templates
Is this a bug or is this me ? (I'm a new to craft)
When using the @web alias directly within an attribute in a Twig template, the alias doesn't seem to be resolved to its corresponding URL. Instead, ...
0
votes
0
answers
44
views
composer update for Craft 3 to Craft 4
Trying to migrate a site from Craft 3 to Craft 4. Carefully followed the instructions to update my composer.json file to reflect the Craft 4 versions of Craft and all plugins. When I run composer ...
0
votes
0
answers
27
views
Disable specific search syntax with colon
I have a search page which searches in products.
Unfortunately some of these products contain a colon : in the title.
This triggers the search syntax that is built into Craft.
How can I disable this ...
4
votes
2
answers
816
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
56
views
Default language is accessible without locale in URL
I have a website with 2 languages. Each language is setup as a different site.
Each site has its own base URL which is defined as follows: @defaultUrl/en and @defaultUrl/fr.
I have created a new ...
0
votes
0
answers
63
views
Content revision issue for every code deployment
The content reversion issue was reported during the production deployment of a new module on the Craft CMS site.
To address this issue, we suspect the below deployment scripts are causing the content ...
2
votes
1
answer
104
views
OPcache extension Warning
I updated my Craft installation to 4.5.3, right? And then I noticed this warning pops up in the system report, saying, "The OPcache extension is recommended in production environments." ...
1
vote
1
answer
24
views
How can I edit a view entry from the view, such as a lightswitch check, without opening up the form?
In Craft CMS I can see views of my my entries through singles, structures, or channels.
I can see a lightswitch checkbox have a green check in the view. I'd like to be able to edit the view directly ...
0
votes
1
answer
33
views
Add chosen location in URL and show content accordingly
We're building a website for a company with multiple locations which need different content but based on the same templates.
I currently have a section Locations.
What I want to achieve is to ...
0
votes
0
answers
23
views
Does descendantOf only accept a single value?
I have a products page on which I'm filtering with Sprig.
There are some categories in the form of checkboxes.
These categories have some subcategories.
The categories are a structured section with ...
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 ...
1
vote
1
answer
62
views
Craft CMS 4: Update without proc_open
I've recently managed to upgrade my Craft installation from 3.9.1 to 4.5.0. During the upgrade process I had a number of times where the update process from within the admin GUI 'failed' or at least ...
0
votes
0
answers
25
views
Feed me with Google sheets and matrix fields
Our client delivered a list of products in the form of a Google Sheet.
Some products contain some extra information which should we presented in the form of a list on the website.
Currently these ...
0
votes
0
answers
24
views
Codeception Unit test using fullMock
I have a custom field for which I would like to write some basic unit tests. I was looking into fullMock: true since really don't need a full Craft environment. I want to test the normalizeValue() ...
0
votes
0
answers
18
views
How to adjust entry fields to have different width based on field value in Craft CMS 4
I have created a entrytype where there are multiple sets of fields. One for each of 4 different languages.
In the entrytype i have selected a field of checkboxes and added conditional logic for which ...
1
vote
1
answer
65
views
Create deep copy of twig variable
I'm building a filter page with Craft and Sprig.
The goal is to show the amount of products for each filter.
So for example if we want to filter on color we show 2 checkboxes "Red" and "...
0
votes
0
answers
55
views
Craft cms[4.x]: Frontend Site broke after performing a feed with feed me
On our last data migration from wordpress i import through feed me all the data but the postDates.
31-08-2023 11:12 I imported a csv file in feed me with all the posts content including the postDates ...
1
vote
1
answer
85
views
I can't update the craft CMS. Returns an error
CRAFT CMS 4.5 has been released. I have updated to this version calmly. There are new updates 4.5.1, 4.5.2, 4.5.3. But when trying to update the system, it gives this error:
Ошибка: The command "...
1
vote
1
answer
47
views
Boolean false Feed Me data is not being processed
I have a feed that needs to map data to a lightswitch field. When the API returns data for that field that equates to boolean true, it works fine. But when the data equates to boolean false ("...
1
vote
2
answers
36
views
Conditional - Apply After Every Third Loop
The following is messy and obviously not scalable. There must be a way in twig to target a common difference of 3 right?
{% if loop.first or loop.index == 4 or loop.index == 7 or loop.index == 10 %}
...
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
25
views
Disable URL's for nested levels in structure but keep URL's for the 2 top levels
I have some products with categories that go 4 and sometimes 5 levels deep.
The site will have an overview page for the first 2 levels.
For example: my-website.com/category/subcategory
I have created ...
0
votes
0
answers
24
views
Live preview button(s) gone after enabling different domain for control panel
I'm building a Craft website which will need another domain for the control panel.
The setup for this has gone good using this article. => https://craftcms.com/knowledge-base/access-control-panel-...
1
vote
1
answer
75
views
Run craft up command in deployment pipeline without prompts
I am deploying a Craft website with Bitbucket Pipelines.
Basically what it does is spinning up a container that runs composer install and builds my CSS and JS with webpack. The vendor folder and js/...
0
votes
0
answers
18
views
CP routes are suddenly prefixed by /web/ directory
I've deployed my website for a second time but there is a problem now..
When I navigate through my page, everything works fine apart from one page that fetches a graphQL query, but this returns an ...
1
vote
1
answer
69
views
Craft 4 move entries
I have two sections with the same fields. I want to move entries from one section into the other section.
There is this post but its there a better way in Craft 4?
1
vote
1
answer
27
views
Plugin migration - how to handle count in php8.1
I am trying to migrate a plugin from Craft 3 to Craft4 .
The plugin basically checks the entry for a pdf asset and create a thumbnail asset from the PDF using Imagick to save with the entry.
I use to ...
1
vote
2
answers
60
views
GraphQL queries for srcset
I am trying to fetch srcset with GraphQL from Craft4 but I don't really understand the syntax. In my twig Templates I use image.getSrcset(['1x','2x'],'myTransformHandle') and I'm trying to translate ...