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
0
votes
0answers
24 views

How to create an array of items and fetch them with .all()?

Is there a way to create an array of items, fetch them with .all() and loop through them? For example: {% set array = array|merge([block]) %} {% for block in gallery.all() %} {% endfor %}
0
votes
0answers
34 views

How to use a table field in custom plugin's settings (Craft 3)

I need a table field in my plugin's settings, but when I make 2 rows and save the settings, only the first row is shown when I go back to the settings page. When I dump the values, my second setting ...
0
votes
0answers
26 views

Disabling Imager's 'auto' transform, only returning transforms if they exist

We have a situation where we to use Imager with a very very long cache duration for transforms, but we never want to carry out Imager transforms as the result of front-end activity (Thousands of ...
0
votes
0answers
118 views

URI is not a valid URI error after recent update

Has this old issue recurred in a very recent update: URI is not a valid URI Just a few weeks ago I imported Korean content using FeedMe just fine, I have a setting 'limitAutoSlugsToAscii' => false, ...
0
votes
0answers
9 views

AssetBundle-related when installing a plugin via console and not via Cp

I have a plugin which registers an AssetBundle. The asset bundle itself is quite basic and only includes one JS-File. In the init() method of my plugin, I register the bundle: // registering the ...
0
votes
0answers
14 views

Fetch the entries based on local time zone

I am trying to fetch the entries based on the local timezone. $entries = Entry::find(); $entries->section('news'); $timezone = new \DateTimeZone(Craft::$app->getTimeZone()); // current site ...
0
votes
0answers
15 views

SQL to delete all entries and a matrix field from the database direct due to Craft issues in the admin

What would be safe SQL commands to delete all entries from the database? And similarly to delete all content from a specific Matrix field? The reason is because Craft seems to have an issue with ...
0
votes
0answers
99 views

Docker + Webpack for a Craft installation

I've tried to make an installation of Docker + [NyStudio's webpack][2]. I haven't been able to get it working. Neither webpack nor Docker is my specialties. I've uploaded this repo https://github.com/...
0
votes
0answers
26 views

Feed me not adding disabled entry to an entry field

I have multiple feeds, one of them creates entries in a channel "Memberships", and another one relates memberships to locations via a memberships field. The first feed created the memberships offline....
0
votes
0answers
128 views

Database Exception: Column not found

I have been updating my plugins and Craft CMS to 3.2. When trying to login to the admin I get the following error: It seems to be stumbling over a field that should be in place. The field type is "...
0
votes
0answers
34 views

Update asset index by PHP in Craft 3

In my plugin, I need to update asset indexes because it makes new asset folders. I found this question, but the answer is for Craft 2. How do you programmatically update an asset index? It does not ...
0
votes
0answers
46 views

CraftQL: Upsert Category fails with error

I'm trying to add a category to a Categories relationship field on an entry type called Projects. However, this returns "error": "A non well formed numeric value encountered" Per MutationTest.php -- ...
0
votes
0answers
63 views

Setting “enabled for site” from a plugin

I have entries that propagate across multiple sites. Default value is enabled in general but disabled for all sites. I want it to be enabled for the site to which it was originally added (while ...
0
votes
0answers
24 views

Double encoded querystring parameters in pagination urls

Since upgrading to Craft 3.2 I've noticed that my querystring parameters are double encoded in my pagination urls? Example below: /search/p2?s=cancer&t%255B%255D=blog Edited: After a bit of ...
0
votes
0answers
19 views

Use one entry's records in Dropdown field

Let's assume we have two sections... the 1st is topic and the 2nd is videos. I want to filter videos from topic's name. So I want to use topic name as a dropdown in the videos section. But I don't ...
0
votes
0answers
16 views

Difference of Restore Password Link

I have my own set password form for my site. However, the provided link does not always go to the own reset password form. Actually, there are two formats of the URL. 1) This link goes to my own ...
0
votes
0answers
9 views

I'm not able to select assets from Asset field inside Matrix. On console I see Double-instantiating a menu button on an element

When I try to add an image from a Matrix field, I just get the asset window but I'm not able to search for or select an asset. This just happens on entries with Matrix fields. Also, in the console, I ...
0
votes
1answer
35 views

How do I fetch all categories under a category group using the Element API?

I am not too familiar with PHP and am just learning the Element API. How do I turn this craft query into an element api query? craft.categories.group("brands").level(1).all(), In categories this is ...
0
votes
0answers
16 views

Calling unknown method: craft\console\Request::post() - Component.php: 300 When getting post variables using CLI

I have the following script which works fine when saving in the admin: /* * Update all slugs within the site group in case it changes */ Event::on( Elements::class,...
0
votes
0answers
22 views

How can I sync slugs within sites in the same Group?

I have a Craft site with approx. 13 Sites. They are grouped by language, e.g. German has Germany and Austria in it. Spanish has Spain and Mexico in it. I imported all content to the main groups ...
0
votes
0answers
21 views

Stripe Webhooks Missing?

Set up Stripe according to the docs, but it appears that my generated URL is just missing. Stripe can't contact it, and going directly to it results in a 404 error. Any idea if I can re-establish ...
0
votes
0answers
45 views

Download asset from a form

A few months ago, I developed a form to download asset. The form helps to download files from entry page or user profile page, as this question. Is it possible to have secure (private) assets? ...
0
votes
0answers
20 views

SEO plugin fails on recent updates

The upgrade logs for ethercreative/seo says to backup before upgrading, but gives no explaination on how to fix the issues if you get them. bash-4.4# ./craft seo/upgrade/to-new-data-format Exception ...
0
votes
0answers
55 views

Import user passwords

I'm using Feedme to import users from one Craft site to another via an XML feed. I'd like to include users passwords too. I thought that {{ user.password|hash }} would do the trick but when I test ...
0
votes
0answers
46 views

Craft 3 - User Upload File

I have a front end form and it's goal is to upload a file that can be seen in the users area in craft 3 backend. How can i do this in craft 3 with twig. I know how to save users input fields like in ...
0
votes
0answers
13 views

Show asset field value when asset is disabled for the site

I have an asset field type called organisation which points to another entry. That entry can be disabled for the current site, but I want to display it regardless. In Craft 2 the below code worked, ...
0
votes
1answer
33 views

Adding more data to the “commerce/cart/update-cart” action [duplicate]

Is it possible to add additional data to the "commerce/cart/update-cart" callback? For instance, we want to include an Asset field so we can populate a cart modal with the item's image in one call? ...
0
votes
0answers
22 views

Subsites not found when running Craft 3 on shared hosting

On most shared hosting, you can't set the webroot. As an alternative, a rewriterule to the web folder can do this. Could be something like RewriteRule ^(.*)$ web/$1 [L]. This works on main sites in ...
0
votes
0answers
23 views

How to access Google Tag Manager cookies in Craft/Twig?

I am trying to access a cookie that was set with Google Tag manager. Is there anyway I can access the value? I tried craft.request.getCookie(name) but Craft or Twig isn't recognizing the cookie. Is ...
0
votes
0answers
7 views

Unable to create new category groups in plugin

So, I'm writing a plugin to assist with a content migration which will be creating new category groups. I'm able to successfully run the plugin, and what's strange is that the category group does get ...
0
votes
0answers
45 views

Combining env variables with strings in settings

I have a site with multiple subsites in the following structure: www.site.domain/subsite. To create multiple subsites, I'd consider setting a base url in the .env (for easy changes: localhost <> ...
0
votes
0answers
65 views

How to sync/propagate entry titles in a site group?

I have created several site groups, e.g. English, Spanish and German. Within these are several sites and the fields are to translate per group. So within Spanish for example, all the content is the ...
0
votes
0answers
12 views

Controller conflict?

We are running Freeform and Snaptcha on a site and having problems with submitting Freeform posts. Basically, the Freeform form is always submitted but the Snaptcha response always fails. This means ...
0
votes
0answers
87 views

Huge job queue, hundreds of pending jobs, queue increasing faster than is processed

How do I avoid building up a massive job queue or have them process quicker? I think it even stalled and I used a plugin called Queue Manager to try them again. I have approx. 300 in the queue now, ...
0
votes
1answer
36 views

Fatal PHP error upon installation

I attempted to install the newest version of Craft and received this error in my logs: PHP Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\craft-cms\vendor\yiisoft\yii2\...
0
votes
0answers
28 views

Batch update/edit Commerce product slugs to match their SKU?

Our client has entered hundreds of products from their catalogue, but their autogenerated slugs are inconsistent with their SKUs. Eg in the screenshot below, the first 3 products have correctly ...
0
votes
0answers
22 views

Setting a variable to a Matrix field with additional parameters

I'm trying to set a variable to a Matrix field and apply additional query parameters like so: {% set monthDates = entry.scanDates.type('dates').date('and', '>= ' ~ currMonthFirst|date('Y-m-d'), '&...
0
votes
0answers
24 views

Rename files uploaded to certain sources in Craft 3

I have an event written for Craft 2 which renames files, which are uploaded to certain sources, to have a 35 character random string, plus its original extension. I am looking to update this for ...
0
votes
0answers
41 views

Hooking Event After Record Save

I have a custom module that is receiving data from an external API. I need to save some of that data into a record and return a success response, so far all is good. Along side this I want to set up ...
0
votes
0answers
51 views

CSS folder with XAMPP and Craft Cms

I am using XAMPP with Craft CMS 3. I am doing the tutorial with craftquest. I have moved the stylesheets folder into my web folder but craft cant seem to find my folder? How do i make craft find the ...
0
votes
0answers
29 views

How to disable “show On Homepage” option from CP

I am created entry. That entry contains title and page content. And the title of the entry show on menu bar of my site. But I want some entry to not show in the menu bar. How can i do this?
0
votes
0answers
20 views

How to access controller method from a plugin script?

I have created a custom TwigParser which needs to execute some controller logic in a similar way to how CraftCMS's {% requirePermissionNode %} Twig parser does. Their implementation accesses the ...
0
votes
0answers
84 views

SCSS is not parsed in CSS using the SCSS plugin

I have a quick question about the SCSS plugin for Craft CMS I have successfully installed and activated it. Dependencies like leafo / scssphp are also installed. In the I have included the files: ...
0
votes
0answers
37 views

Craft CMS: Goes Unresponsive

I have an issue with the Craft3, after a few requests and clicking around the whole site (front-end and CP Admin) seems to hand and lag. Also I get a popup message on Google Chrome mentioning that ...
0
votes
0answers
21 views

Possible to move matrix content from one global set to another

Is it possible within the database to manipulate a couple of keys to move matrix content to another global set without having to re-enter it all in Craft 3? I have the matrix field in both global ...
0
votes
0answers
64 views

Category select field in custom plugin settings not saving

I am trying to show a list of categories on my plugin's settings page so an admin can select multiple categories. I am doing this with a Craft form macro: {{ forms.elementSelectField({ label: '...
0
votes
0answers
92 views

Shopify - Connect existing Element API/Vue JS site to new Shopify store

I have a Craft 3 site, currently running using the Element API and Vue JS as follows: VueJS: Product grid component ... mounted(){ this.getGridProducts() }, data() { return { ...
0
votes
0answers
125 views

Can't save fields

I want to change some fields and when I click 'save' it goes to the list of fields and the changes aren't saved. I can't add fields either. I can add and edit entries for example.
0
votes
0answers
36 views

Install of Craft 3 on Windows server gets 404 error on admin pages

I have tried installing Craft 3 onto a Windows 2016 server a few times and I've gotten the same issue where after an install I am redirected to the Admin page and have a 404 server error. I am using ...
0
votes
0answers
71 views

FeedMe Import Error: Can not create a node when the target node is new record

Trying to do an import using FeedMe. Earlier it was just a few entries are not created, getting the below error in the logs. i decided to start again, delete all entries and re-import, now no entry is ...