All Questions

1
vote
1answer
17 views

Allowing CRAFT_TEMPLATE_PATH in index.php from .env variable

It appears on Craft 3.1.8 that I can't set the CRAFT_TEMPLATE_PATH from .env without throwing a PHP notice error. This appears to be because the .env is loaded after the defines and I want to access ...
1
vote
1answer
25 views

How to change an entry's slug on EVENT_AFTER_SAVE_ELEMENT?

My entries' titles are auto-generated from several fields values on first save. When one of these fields values change, I would like to update the auto-generated slug also: <?php Event::on( \...
1
vote
0answers
33 views

Adding a row to a table field with CraftQL/GraphQL

I am trying to mutate/add a new row to a custom user field, which is a table. The problem is that the mutation does not add a value, neither is adding a new row, it just overwrites the existing row ...
2
votes
1answer
39 views

Tabs in a Matrix Field

In this video it looks like Courtney has tabs (Content | Design) in the individual fields in a Matrix. I can't work out how to do this, is it a plugin? It seems a great way of organising the fields ...
0
votes
0answers
17 views

Craft 3 with Craft Commerce not cleaning up deleted products correctly

We have a Craft 3 install with the "Try" version of Craft Commerce. When we have a product type with variants we seem to be having issues with products cleaning up correctly after they have been ...
1
vote
1answer
33 views

baseUrl outputs environment variable

The newer versions of Craft CMS stimulate using environment variables in the CP. It works perfectly. I have set two variables for sites in my .env file: DUTCH_SITE_URL="http://company.test" ...
1
vote
1answer
29 views

Custom plugin field in Table Columns?

I just created my first Craft 3 plugin. In the plugin I also have a custom (select)field. Everything is working as expected, which is great! But I can't for the life of me figure out, how to add this ...
-1
votes
0answers
33 views

New field creation is causing craft to give a PHP Warning – yii\base\ErrorException - array_merge(): Argument #1 is not an array

When I attempt to create a new field that is not a plain text type craft outputs PHP Warning – yii\base\ErrorException array_merge(): Argument #1 is not an array After the error, when I check the ...
1
vote
2answers
81 views

Craft 3: Cron job to run Controller actionIndex method of a Plugin

I have made a Craft 3 plugin that is manually used in the Craft Admin CP area; click a button and we sync products in Craft with a Shopify API. Now I am trying to automate the process. I would like ...
1
vote
1answer
26 views

Is it possible to repopulate radio button inputs with values from submission.fieldMetaData using the standard form.render() method?

I've been able to repopulate text fields this way, but the radio buttons remain unchecked even when there was a value submitted. {% for field in application.fieldMetaData %} {% set ...
1
vote
1answer
19 views

Revoke user permissions but not change the usergroup

I have a client who would like to edit a users permissions. However instead of adding permissions on a per user basis, they would like to remove permissions for that user by unchecking the item. ...
2
votes
1answer
78 views

Selling tickets to repeating events with Commerce (and Solspace Calendar?)

We need to build a ticketing system for venue tours, that happen every week within certain date ranges, and with an option to exclude specific dates from the availability list. Looking at Solspace ...
1
vote
1answer
38 views

Relationship between channels/entries

I need some help. Really struggle understanding how to build relationships between channels/entries. Context/Want: I have two separate channels: 1. "Plant catalogue" 2. "Plant care" I want to re-use ...
1
vote
1answer
41 views

_entry.twig isn't reading css while index does

This is the template im using and the index of the file is taking the css and printing it nicely however, the _entry.twig is only loading text, please check out the screenshots. Below is the index of ...
1
vote
1answer
27 views

MySQL “Access denied for user” after moving to new server

I've moved my Craft 3 installation to a new server. When connecting to the original database, everything works fine. However, when trying to connect to a new MySQL database (I've tried hosting this ...
-1
votes
0answers
24 views

Subdomain don't work

I have a big website in 6 languages. Reachable at bar.com Now I want to create a Landingpage for a subdomain. So I created a new Site in Craft named "landingpage" and set the basic url to foo.bar.com ...
1
vote
0answers
11 views

Templating not displaying after Craft server migration

A small team and I have inherited a Craft 2 site. We are brand new to craft with no previous experience with it. In wanting to work on offline copies of the sight the team is attempting to migrate the ...
-1
votes
0answers
21 views

Saving current time in Entry Form goes wrong

In my front-end I have an Entry Form where I want the Current time to be submitted in an hidden field. Which works. But strangely enough it adds +1hour upon saving the entry. In my form, this is the ...
1
vote
1answer
28 views

Custom title using URI segment

I am working on my SEO and I am getting a duplicate title in Craft. I want to make a custom title using the URI segment in using PHP.
1
vote
2answers
21 views

Feed Me in Templates - can't pull in <itunes:summary>

I'm using Feedme to display content in my temmplates from a podcast RSS feed - not importing entries, just displaying. Everything is working fine except that I can't display the <itunes:summary>...
0
votes
0answers
27 views

Cannot add new field when Project Config enabled

I'm working locally and am unable to create or edit fields if I have project config enabled in general.php '*' => [ 'useProjectConfigFile' => true, ], If I change that to false I can add ...
0
votes
0answers
16 views

Template 404 when receiving external POST data

I have a template which acts as the "thank you for booking" page for a tour company. However, the payment gateway sends the POST data along, and it's causing the template to 404 - even though there's ...
0
votes
0answers
22 views

Is it better to let Craft handle my API calls instead of recreating the same functions

First of all, I am just a student so please go easy on me. I am creating my first API for Craft cms and Commerce for an Android application. The steps I did was as follows: I created a plugin and ...
0
votes
0answers
11 views

How to query Elements with an entry field count of zero

I have an Entry 'Product' which cans zero or more 'Components' I am trying to figure out how to query all Product entries that have zero components. I can do this to get everything: $entries = ...
0
votes
0answers
16 views

Iterate through Super Table field in plugin

I have a Super Table field with two columns, one is a category field, the other an assets field (limit 1 on both). How can I iterate through it to get the category and asset selected for each row in ...
1
vote
1answer
35 views

How to reorder structure entries in the Admin panel?

I converted a channel into a structure and now my entries are listed in reverse order. I have a very large number of entries. Is there a way or a plugin to permanently sort them and store the order?
1
vote
2answers
18 views

Upload failed. The error message was: "SQLSTATE[23000]: Integrity constant violation:

I'm getting this strange error when I'm trying to upload an .jpg in the assets. Env: Localhost Craft version 3.1.8 MAMP: - PHP(7.2.7) - MySQL: 5.7.21 Upload failed. The error message was: "...
1
vote
1answer
33 views

How do I resolve dependency conflicts in Composer?

I'm new to using Composer and I'm having trouble deploying to Laravel Forge. I am getting an error message that says: Your requirements could not be resolved to an installable set of packages. ...
1
vote
1answer
23 views

Internal server error message

I'm getting the following internal server error message when I try and make a change on my website. It is only happening on one page! file_get_contents(https://maps.googleapis.com/maps/api/geocode/...
1
vote
3answers
34 views

Querying Entries by Month and Year

Good morning, If have have a URL that passes parameters: http://url?month=January&Year=2018, how would I go about querying all entries in section where the postDate equals January 2018? I can get ...
1
vote
1answer
25 views

Craft 3 redirecting me 404 after fill up registration form

I have created copy whole HTML from here (https://docs.craftcms.com/v3/dev/examples/user-registration-form.html). and trying to register but it's showing me an error or we can say it redirects me to ...
1
vote
1answer
72 views

Internal Server Error while migrating to new server

I'm trying to migrate to a server from my local environment. I keep getting Internal Server Error. I have the latest version of 3+ of CraftCMS. Everything works fine locally but on the server not so ...
0
votes
0answers
19 views

Imager - HTTP status “401” error while generating transform

When I uploaded the website to a new server, some transforms don't generate and throw an exception instead: HTTP status “401” encountered while attempting to download “https://domain.com/web/uploads/...
1
vote
0answers
19 views

How to keep a users cart active after logout - Craft Commerce 2

How do I set the cart to save / stay active in a users account. When I add some products to my cart (when logged in) and logout or close my browser the next time I come back my cart is empty. I'd like ...
2
votes
1answer
33 views

Element API calling Module that integrates with third-party plugin

This is probably a bit niche but anyone especially au fait with the element api here? On project X I have a custom module within which I am referencing a service from another plugin (bolden/google-...
1
vote
0answers
16 views

How to modifyPaymentRequest() in Commerce 2?

Looks that I really used every functionality in my plugin that changed or has been removed in Commerce 2. :( I need to modify paypal transactionId and description what i did as follows in Commerce 1: ...
1
vote
2answers
30 views

Login Modal - How to handle incorrect password / credentials?

I'm developing a site in Craft 2, using a modal to display the login form. The modal can be seen by clicking the Login button at top right. I'm essentially using the form as outlined in the Craft 2 ...
0
votes
0answers
7 views

No EVENT_DEFAULT_ORDER_STATUS in craft\commerce\services\LineItems?

The Commerce 2 docs shows LineItems::EVENT_DEFAULT_ORDER_STATUS as a parameter for the event beforeSaveLineItem and afterSaveLineItem, but craft\commerce\services\LineItems did not have a constant ...
1
vote
2answers
33 views

Contact form on form submission redirects to index.twig

I've run into issues with the contact form plugin - https://github.com/craftcms/contact-form/issues/156 - Any ideas
2
votes
0answers
39 views

Diagnosing Slow Database Connection for Entries (Frontend and Craft Admin)

We have set up a remote database connection for Craft CMS so that I and my colleague can work on the same database locally. The connect seems very slow both front end and in the admin area. ...
1
vote
1answer
29 views

How to duplicate a matrix field programatically in Craft 3.1?

Is there a "Craft" way of handling this in 3.1? Solutions to this question on SE are based on older versions of Craft which no longer work. Custom fields can be duplicated by doing: $newEntry->...
0
votes
0answers
17 views

What are the options for adding a new Craft user to a Campaign Monitor list?

I have public user registration on the front-end of a site. I'd like new users' email addresses to automatically be added to a Campaign Monitor list when they register. I see that Freeform's Element ...
1
vote
2answers
43 views

Twig sometimes breaks JavaScript or CSS

Sometimes when your javascripts or stylesheets are formatted a certain way, twig seems to try and render those snippets (whom always include curly brackets in some way). For example, if you end you'...
0
votes
0answers
32 views

baseUrl and trailing slash Craft 3

Despite setting baseUrl alias with trailing slash it appears it gets stripped off in Craft 3. CRAFTENV_BASE_URL="https://domain.test/" 'aliases' => [ '@siteUrl' => getenv('...
1
vote
1answer
50 views

Setting Up Multiple Sites

I've tried following the guide for setting up multiple sites (https://docs.craftcms.com/v3/sites.html#creating-a-site) but I think i'm missing something. Firstly the craft install on your beta site, ...
1
vote
2answers
29 views

Blog template not displaying posts

The blog post should display the posts created but when I got to the slug /blog it says 404 not found as well as the press news should be displayed here /press-news but same thing happens. If i ...
0
votes
2answers
48 views

Page ignoring template

One of my clients' sites is https://anovaworks.com/. The second section on the homepage looks like this: There's some small black text in the top left of the image that's coming from a matrix field. ...
2
votes
2answers
32 views

How do I prevent a controller from creating unwanted routes?

I have a custom module that is adding sections to the CP, like this: // Register CP routes Event::on( UrlManager::class, UrlManager::EVENT_REGISTER_CP_URL_RULES, function(craft\events\...
1
vote
0answers
13 views

What are the replacements for the order events onBeforeAddToCart and onBeforeGatewayRequestSend in Commerce 2

I'm looking for replacements for the events onBeforeAddToCart and onBeforeGatewayRequestSend. I used onBeforeAddToCart to prevent the user from adding an article from different article groups to the ...
1
vote
1answer
14 views

Access table from Globals in script

In the Globals I have a field which is of type table. I was trying to access this table in the javascript in order to get the values of particular rows. <script> var myTable = "{{ ...

15 30 50 per page