Archived topic
option_generate_settings customizer error
11 replies · Started by Alex on October 19, 2022
Hello,
I am currently building a child theme that adds custom colors to the GeneratePress global palette using the generate_option_defaults and option_generate_settings filters. The custom colors are added when an image is uploaded in the customizer panel. After saving and viewing the page, I get an error triggered by wp_die saying "Something went wrong, the changeset could not be further modified."
After doing some googling I found this error could be triggered by missing dependencies. Query Monitor reports a GP script (specifically generate-blog-themecustomizer is missing a dependency (generate-blog).
This error *does* only happen when my theme is active yet I am unsure how hooking into the filter can cause this kind of error. Some guidance or feedback would be great. I can provide further information/images if needed.
Hi Alex,
The custom colors are added when an image is uploaded in the customizer panel.
Can you explain a bit more about how this works? And the code you are using to achieve this.
Let me know!
Hi Ying,
Thanks for the quick response.
I have an image upload control in the customizer panel. When the user uploads an image to it, I use the WP javascript customizer API to extract a color palette from it. Then I send the custom color palette back to PHP using a REST API endpoint. The endpoint callback function in PHP saves the color palette in the options table.
In the GP filter hooks, I get the custom color palette from the options table and add the colors to the GP global color palette.
Hope this helps!
Hi there,
I doubt that a dependency would cause an issue like this.
Are there any console errors? At what point in the process you explained above do things fail?
Hi Tom,
Thanks for the response.
I get the error in question after uploading the image in the customizer, saving, then viewing the site, then going to the customizer again. Instead of going straight to the customizer, I see the "something went wrong" error.
I am also led to believe this could be a dependency error because when I check Query Monitor, I see it's supposedly missing generate-blog.
When I check the browser console, I see a 403 error, perhaps the changeset UUID is somehow invalid?
I appreciate all the help!
The changeset error typically meant the link to the Customizer has an existing changeset in the URL. Can you confirm the URL of the Customizer when that error happens? Have you tried loading up the Customizer with a clean URL?
Yes, the customizer URL contains a changeset_uuid query. The customizer also loads as expected with a clean URL or after simply removing the changeset_uuid query in the URL.
That changeset uuid shouldn't still be there in the URL once you've left the Customizer. The error you're getting makes sense if it's still a part of the URL. I'm not really sure why it would be sticking around like it is - I'm assuming there's an error somewhere in the custom control.
Okay, thanks for the clarification. Do I need to manually account for the customizer changeset UUID in my own code?
You shouldn't. Core should handle all of that kind of stuff.
Just to confirm, you're saving your custom control, then clicking the "X" to leave the Customizer. Then when you re-enter the Customizer, the ID is still there?
Yep. I update my custom control, publish the changes, and exit the Customizer. After exiting the Customizer and returning to my WP website, the customize_changeset_uuid query appears still in the website URL. I get the changeset error after trying to enter the Customizer again.
Thanks so much for your continued support, Tom!
I wish I could be more helpful - I have no idea what would cause that to happen.
You'll need to debug things bit by bit - turn off small parts of your custom code bit by bit until the problem goes away. This will at least give you an idea as to what's causing it.