Questions tagged [config]

Craft configuration and settings.

Filter by
Sorted by
Tagged with
0 votes
1 answer
46 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 ...
user avatar
  • 63
2 votes
1 answer
36 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 ...
user avatar
  • 283
0 votes
0 answers
14 views

Fields are saved, but not loaded for some blocks

I'm experiencing an issue on my development-environment, and I cannot figure out what's going on. It seems that the fields of some of our blocks aren't being retrieved after saving. To reproduce I ...
user avatar
1 vote
1 answer
28 views

email settings per environment not working

I'm trying to set this up changing config/app.php with 'dev' => [ 'components' => [ 'mailer' => function () { // Get the stored email settings ...
user avatar
  • 1,793
2 votes
1 answer
29 views

Project config priority between project config files and database

I want to completely understand how Craft loads the current settings on a site. And there are two things I didn't find in the documentation: Question part A. Does the database take precedence or do ...
user avatar
3 votes
1 answer
286 views

Multiple developers working on the same site - Project config issues

I am working on a site with other three developers. We are all working on different features for the same site. We are having conflicts with project config files, since we are merging our changes into ...
user avatar
0 votes
0 answers
23 views

Craft messes up Color Profiles on Upload

It's known that Craft CMS sometimes messes up color profiles when using image transforms. Up until recently, adding 'preserveImageColorProfiles' => true to your general.php fixed this issue. But ...
user avatar
  • 21
1 vote
2 answers
229 views

@webroot - how to find out path?

Getting "Error clearing cache Control panel resources: Unable to clear control panel resources because the location isn't known for console commands" and the recommendation to set @webroot ...
user avatar
1 vote
1 answer
60 views

How do I renew Craft CMS license?

When I go to Updates in my home Dashboard, I see there are "5 updates available!" I click "Go to Updates" and a big orange ribbon pops up that reads: Your license has expired! ...
user avatar
1 vote
2 answers
31 views

Product Search - redactor description field not indexing

I am struggling to get my head around plurals and fuzzy search etc. I have seen this article, which seems to help answer this but am hoping someone can clarify based on my scenario Search forms ...
user avatar
1 vote
1 answer
91 views

Template URL/path alias

Is there any way to use an environment variable in the URL and template path settings for sections? We are prototyping a site with a temporary skin running alongside our front-end build but would ...
user avatar
  • 1,721
0 votes
1 answer
32 views

Non-www connection refused issue

I have a strange issue on my installation. It works fine as www.domain.com but if I redirect to non-www in the .htaccess, it redirects but gives me 'Connection Refused'. the same happens if I go to ...
user avatar
1 vote
0 answers
50 views

Redirect to frontend login form after receiving email verification mail from CMS?

I'm working on a site with public registration and a manual approval flow for new users. The following settings for user accounts are active: Verify email addresses, Allow public registration, Suspend ...
user avatar
  • 6,315
3 votes
1 answer
383 views

Invalid Configuration Error in Craft CMS 3 using Nitro 2

I'm getting into Nitro 2 and so far loving it. I decided to create a scaffolding project to jump start other projects. Along the way, I ran into this error: Invalid Configuration – yii\base\...
user avatar
  • 85
0 votes
0 answers
16 views

Can control panel date display always be numeric?

I understand the display of entries' postDate, etc., in the control panel can be localized, but I'm wondering if it's possible to get rid of the "yesterday" and "today" designators,...
user avatar
  • 596
0 votes
0 answers
29 views

Updating user email does not update username when useEmailAsUsername is set

When the config setting useEmailAsUsername is set, I would expect updating a users' email address to also update the username field when saving the element. However, this does not occur unless you ...
user avatar
2 votes
1 answer
531 views

Custom Aliases not working

I'm trying to setup aliases following the instructions in the docs, but I can't get them to work (for example they don't appear when setting paths for Assets). I copied and pasted the code exactly as ...
user avatar
1 vote
2 answers
49 views

Exporting site configurations for import to new websites - separate databases

Is it possible to export the site configurations of one website in terms of the site structures, not the content, for importing into another site with a separate database, essentially creating a site ...
user avatar
2 votes
1 answer
248 views

Use of App::env() compared to getenv() since Craft 3.4.18

I've noticed since Craft 3.4.18 there is a App::env() function from craft\helpers\App::env(). This was created from the discussion here it seems: https://github.com/craftcms/cms/pull/5893 It seems ...
user avatar
1 vote
1 answer
169 views

What are the yaml files in config/project? Should I commit them?

See the title. I'm currently committing the YAML files to our git repo so they deploy to our production server. Is that appropriate? Should I ignore the config/project folder?
user avatar
1 vote
1 answer
167 views

Incorrect canonical URLs and redirect chains

I have installed SEOMatic. However, I am getting incorrect canonical URLs. Here is an example: https://jenoffvanhulle.com/en/ The URL has a trailing slash, the canonical URL not A second problem is ...
user avatar
  • 11
1 vote
1 answer
61 views

Updating plugin/module config via template/controller

I have a plugin/module that synchronises local records with a Google Sheet managed by the client. The URL for this doc is stored in a module config. I want the client to be able to update this via the ...
user avatar
  • 1,721
1 vote
1 answer
119 views

German special characters like umlauts (ä, ö, ü) are not converted correctly with convertFilenamesToAscii

Filenames with German special characters are not converted correctly with convertFilenamesToAscii, e.g. ä, ö, ü are converted in a, o, u in contrast to ae, oe, ue in slugs with limitAutoSlugsToAscii.
user avatar
  • 129
1 vote
1 answer
41 views

Loading assets cross-domain with SSL or non-SSL option

Here's a unique situation. I have three websites. All assets are stored at the domain of the first site: domain.com/files/* The first two sites run completely over SSL. No problem. The third site ...
user avatar
  • 596
1 vote
1 answer
146 views

How can I set an alias dynamically based on request?

I have a multi-domain setup where I run multiple one-pager sites from different domains. For development purposes, I have configured it to work like this: dev has: http://localhost/www.domain1.com ...
user avatar
  • 213
2 votes
2 answers
573 views

How to use SSL for local development with Nitro?

I've created a new Craft CMS project and installed Nitro to run everything in a VM. Now I'm wondering if it's possible to use SSL for the local domain? I didn't found anything in the documentation.
user avatar
  • 123
2 votes
2 answers
332 views

Cleanup Craft Logs

Whenever I have PHP problems I'm looking into the Craft CMS logs. However, at first I noticed there's a ton of stuff getting logged which is useless for me. Under this amount of logs, I can't find ...
user avatar
  • 149
1 vote
1 answer
58 views

Set duration of 'newpassword' link validity via config/general?

Is it possible to modify how long the 'newpassword' links are valid for via a setting in config/general.php? (I've found defaultTokenDuration but it sounds like this might only be for the live preview ...
user avatar
1 vote
1 answer
130 views

How can I configure multi-site base URLs where the subdomains are static but the domain name is dynamic?

For example, let's say I have two sites: abc.example.com and xyz.example.com but I want to also host test versions of those sites at example-test.com. It'd be nice if I could set the baseURLs to http:/...
user avatar
0 votes
0 answers
230 views

Multisite with unique domains not working with Forge config

I have a live install with a primary domain of https://marketing.vessul.co/ which works great. When I've added another site to this install and it's location is another folder such as /extra-site it ...
user avatar
1 vote
1 answer
54 views

Change maxRevisions setting per section

We'd like to keep the revisions feature active on our site, but a few of our content sections are synced with a third-party API and we don't need to keep a revision at all. Is there a way to set ...
user avatar
2 votes
1 answer
382 views

Error using environment variable for email setting

I'm trying to create an environment variable for email settings, but it doesn't work. Here is my email setting at config/general.php 'dev' => [ '@host' => 'host', '@port' => '587', ...
user avatar
  • 139
2 votes
1 answer
107 views

Using element queries in general.php config file

Can i use element queries in general.php file? I wanted to set loginPath based on entry query, like this: 'loginPath' => Craft::$app->entries->section('login')->one()->url ?? false, ...
user avatar
  • 1,195
4 votes
1 answer
1k views

How do you set up live preview for headless Craft CMS installs connected to Gatsby?

How do you set up live preview for headless Craft CMS installs connected to Gatsby?
user avatar
1 vote
0 answers
130 views

Craft 3 multisite: site specific config

I'm trying to do something like this in general.php config for a multi-site setup: // ... 'production' => array( 'myVariable' => array( 'site1Handle' => '111', '...
user avatar
  • 419
0 votes
0 answers
30 views

Copy Live to a Test site on same domain?

I have copied my Craft 2.6 live site directory, and created a test directory on our webserver in an effort to create a test site. Also duplicated the db and changed the configure files to point to the ...
user avatar
  • 1
0 votes
0 answers
2k views

Craft can’t connect to the database with the credentials in craft/config/db.php

I'm trying to upgrade from 2.7.10 to Craft 3. I follow the instructions/ docs to the letter, go to https://###.com/admin and am greeted with the above can't connect to database message. So far, I ...
user avatar
1 vote
0 answers
227 views

How do I get Craft custom settings from inside a module?

Additional settings added to config/general.php are placed in _customSettings private object. This means they cannot be retrieved using Craft::$app->config->general->someCustomSetting. How ...
user avatar
2 votes
2 answers
587 views

Deploying and syncing project.yaml

I have a Craft CMS site set up that deploys through TeamCity and am trying to set up a build step to auto run "./craft project-config/sync". I keep getting an error saying the file can't be found, I'...
user avatar
  • 81
1 vote
1 answer
367 views

New Install, Permission Errors With /storage

I've configured Apache vHosts on a local box and installed a Craft 3 website onto it. This new instance will serve as my "staging" environment for an upcoming website. I've installed with composer ...
user avatar
2 votes
2 answers
448 views

Laravel Forge not honoring Craft 3 maxUploadFileSize config setting

I have a Craft 3 site deployed to a Digital Ocean droplet via Laravel Forge. I have the maxUploadFileSize set to 256B (268435456 in bytes) in my config/general.php like so: <?php return [ // ...
user avatar
1 vote
1 answer
435 views

Best practice for volume aliases in config files

I'm wondering about using a config/volumes.php file to specify volume aliases (instead of putting them in config/general.php). There's a comment in a previous codebase mentioning https://docs.craftcms....
user avatar
  • 448
1 vote
2 answers
364 views

Turning off a site in multi-site/multi-environment config

Given a multi site setup (domain1.com, domain2.com) that also uses multiple environments (dev, staging, production) - how would one configure one of the sites to be turned off in the production ...
user avatar
  • 1,979
1 vote
1 answer
23 views

What files do you have to be aware of when migrating (i.e config files)?

What files do you have to be aware of when migrating a craft application from one domain to another? Are the specific files one should be aware of?
user avatar
  • 11
6 votes
2 answers
928 views

How do I prevent secrets beeing logged in the PHP error log?

Background: I'm running Craft Pro 3.1.19 on PHP 7.2.15 Craft CMS, by default, uses vlucas/phpdotenv to get the configuration (containing secrets / credentials and lots of other stuff) from .env ...
user avatar
2 votes
1 answer
237 views

Use alias for site url based on root url defined as env var?

I was wondering if the following setup is a good practice. In my .env file I defined a single rootUrl var which contains the site root url like this: ROOT_URL="https://www.mydomain.test" In the ...
user avatar
1 vote
1 answer
109 views

How to load entries data in the General Configuration file?

I'm trying to set dynamic paths for values such as activateAccountSuccessPath. This kind of code below from my routes.php file works very well: use craft\elements\Entry; $myAccount = Entry::find()-&...
user avatar
1 vote
1 answer
1k views

Invalid path alias

I'm not sure if I understand the alias concept entirely So I want to create an alias. I write a variable into my .env File: SITE_URL_DE="http://hello.local" Then I put it into my general.php File:...
user avatar
  • 3,664
1 vote
0 answers
445 views

Strange Redactor Config error when importing colleague's database

Description I am getting this error after importing a database supplied from my colleague. I have deleted the vendors directory and composer lock file in an attempt to re-install Redactor. I have ...
user avatar
  • 1,032
1 vote
1 answer
104 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 ...
user avatar
  • 1,886

1
2 3 4 5