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

Setting a subfolder not saved to project configs. #282

Closed
gjhead opened this issue Jun 2, 2021 · 10 comments
Closed

Setting a subfolder not saved to project configs. #282

gjhead opened this issue Jun 2, 2021 · 10 comments
Labels

Comments

@gjhead
Copy link

gjhead commented Jun 2, 2021

Question

I'm not sure if this is a bug or is intentional. But when editing an Optimized Images field, if I select a subfolder for aunder the "Create Optimized Image Variants for images in the sub-folders:" it doesn't get saved to the project config. So if I commit these to me repo, and deploy to staging, I need to go back into the field and re-check the folder. Normally this would be a trivial edit, but whenever I push to Production, I have "allowAdminChanges" set to false, so I am unable to edit this field on Production.

Additional context

It seems odd to have to edit this one setting manually each time I push to a new environment.

@gjhead gjhead added the question label Jun 2, 2021
@khalwat
Copy link
Contributor

khalwat commented Jun 2, 2021

mmmm that doesn't sound right... those fields settings should be saved in the Project Config data, just like any other setting.

Are you automatically applying project config on deploy, and clearing caches, etc.?

@gjhead
Copy link
Author

gjhead commented Jun 2, 2021

It's strange. I have had it happen a few times on this specific site I am working on. I'm hosting it on servd, so each deploy is a brand new build with clean cache. I'll recreate my steps again tomorrow so I can get some more specific info to you.

@gjhead
Copy link
Author

gjhead commented Jun 3, 2021

OK - just pushed a new build and I am seeing this happen again. Attached are a few things:

Screenshot of Stage on the left and Local on the right. Local shows the sub-folder being selected, and Stage shows it's not selected.

Screen-Shot-2021-06-03-at-5 40 31-PM

Also the .yaml file for this specific field from my local machine so you can see what data is being saved to it. Github won't let me attach the .yaml file - but I posted it at this dropbox link:

https://www.dropbox.com/sh/fgz6l7rivs0m5l3/AACdZnoFLDQgLATyAfDuNdLEa?dl=0

The only other thing that I can think of that may be effecting this, is that all of my Asset volumes are being pushed to AWS. using the Amazon S3 Plugin from Pixel and Tonic, V 1.2.11

@khalwat
Copy link
Contributor

khalwat commented Jun 9, 2021

Okay, I just realized what this is... it's actually storing the information in project config as it should, but the volume IDs must be different on production than in your local dev environment.

@khalwat
Copy link
Contributor

khalwat commented Jun 9, 2021

Related to: craftcms/cms#7742

(@mildlygeeky never filed an issue here)

So my thought on how to fix this would be to use the sub-folder name as what to key off of, rather than the UID. This is still fragile, in that the user can then rename the sub-folder and it'll break but... there's nothing I can see that will stay constant here.

@gjhead
Copy link
Author

gjhead commented Jun 9, 2021

Ah, ok I see now. Well, at least I didn't get to far into this particular problem, and I should be able to just pull down my database and make a few edits, so I can get all my environments synced. Live and learn! Thanks again, Andrew!

@khalwat
Copy link
Contributor

khalwat commented Jun 9, 2021

I intend to fix it!

khalwat added a commit that referenced this issue Jun 9, 2021
@khalwat
Copy link
Contributor

khalwat commented Jun 9, 2021

Addressed in: a8a4404

You can try it now by setting your semver in your composer.json to look like this:

    "nystudio107/craft-imageoptimize": "dev-develop as 1.6.34”,

Then do a composer clear-cache && composer update

@khalwat khalwat closed this as completed Jun 9, 2021
@gjhead
Copy link
Author

gjhead commented Jun 10, 2021

Hey! Seems to work so far! Thanks for address this so quickly. You saved me a ton of time today! It's awesome having people like you in the Craft community!

@khalwat
Copy link
Contributor

khalwat commented Jun 10, 2021

Thanks for your patience -- will likely release it today!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants