Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

database keeps absolute path to project.yaml references/files #3546

Closed
thatONEjustin opened this issue Dec 11, 2018 · 3 comments
Closed

database keeps absolute path to project.yaml references/files #3546

thatONEjustin opened this issue Dec 11, 2018 · 3 comments
Assignees
Labels
bug project config 🐫 features related to Project config severity:normal Bugs that affect typical usage

Comments

@thatONEjustin
Copy link

thatONEjustin commented Dec 11, 2018

Description

If useProjectConfigFile is set to true, the paths for:

  • dateModified
  • email
  • fieldGroups
  • fields
  • plugins
  • sections
  • siteGroups
  • sites
  • system
  • users
  • volumes
  • matrixBlockTypes

are all hardcoded into the database. This is causing an issue between team members as they get file permission issues for a path thaat doesn't exist.

Steps to reproduce

  1. Install Craft 3.1 Beta
  2. set useProjectConfigFile to true in config/general.php
  3. export database (using whatever tools you need)

Example from my export

{\"dateModified\":\"/Users/justin/Desktop/wojo/projects/eregulations/config/project.yaml\",\"email\":\"/Users/justin/Desktop/wojo/projects/eregulations/config/project.yaml\",\"fieldGroups\":\"/Users/justin/Desktop/wojo/projects/eregulations/config/project.yaml\",\"fields\":\"/Users/justin/Desktop/wojo/projects/eregulations/config/project.yaml\",\"plugins\":\"/Users/justin/Desktop/wojo/projects/eregulations/config/project.yaml\",\"sections\":\"/Users/justin/Desktop/wojo/projects/eregulations/config/project.yaml\",\"siteGroups\":\"/Users/justin/Desktop/wojo/projects/eregulations/config/project.yaml\",\"sites\":\"/Users/justin/Desktop/wojo/projects/eregulations/config/project.yaml\",\"system\":\"/Users/justin/Desktop/wojo/projects/eregulations/config/project.yaml\",\"users\":\"/Users/justin/Desktop/wojo/projects/eregulations/config/project.yaml\",\"volumes\":\"/Users/justin/Desktop/wojo/projects/eregulations/config/project.yaml\",\"matrixBlockTypes\":\"/Users/justin/Desktop/wojo/projects/eregulations/config/project.yaml\"}');

Additional info

  • Craft version: "craftcms/cms": "3.1.0-beta.3"
  • PHP version: 7.1
@brandonkelly brandonkelly added the project config 🐫 features related to Project config label Dec 11, 2018
@brandonkelly
Copy link
Member

@andris-sevcenko We may be able to avoid storing absolute paths by passing them through Craft::alias(), which would convert /Users/justin/Desktop/wojo/projects/eregulations/config/project.yaml to @config/project.yaml, for example.

But then there’s the question of what the desired behavior should be when a DB is improved into another environment. Maybe it’s best that the paths are absolute, and if the files don’t exist we just assume all of the files could have been modified, sync everything, and update the config map.

@brandonkelly brandonkelly added bug severity:normal Bugs that affect typical usage labels Dec 11, 2018
@andris-sevcenko
Copy link
Contributor

As far as config map goes, it's there just so when you save anything to project config, it's known to which file to write the changes to, so storing absolute paths isn't required.

If for some reason, DB from another environment is brought in with different values in the config map, then Craft will just store the respective nodes in those files.

As far as modified files go, those are cached using Craft::$app->getCache() so aren't affected. If a file that has a cached modified time goes missing, a sync is triggered.

andris-sevcenko added a commit that referenced this issue Dec 13, 2018
@andris-sevcenko
Copy link
Contributor

Closed via 5ccd5ff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug project config 🐫 features related to Project config severity:normal Bugs that affect typical usage
Projects
None yet
Development

No branches or pull requests

3 participants