- This topic has 11 replies, 3 voices, and was last updated 4 months, 4 weeks ago by
Tom.
-
AuthorPosts
-
October 19, 2022 at 11:46 am #2379144
Alex
Hello,
I am currently building a child theme that adds custom colors to the GeneratePress global palette using the
generate_option_defaults
andoption_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 bywp_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.
October 19, 2022 at 12:23 pm #2379172Ying
StaffCustomer SupportHi 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!
October 20, 2022 at 9:06 am #2380232Alex
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!
October 20, 2022 at 7:56 pm #2380630Tom
Lead DeveloperLead DeveloperHi 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?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentOctober 24, 2022 at 9:34 am #2384479Alex
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!
October 24, 2022 at 8:27 pm #2384798Tom
Lead DeveloperLead DeveloperThe 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?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentOctober 27, 2022 at 12:49 pm #2390416Alex
Yes, the customizer URL contains a
changeset_uuid
query. The customizer also loads as expected with a clean URL or after simply removing thechangeset_uuid
query in the URL.October 28, 2022 at 6:43 pm #2392275Tom
Lead DeveloperLead DeveloperThat 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.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentNovember 2, 2022 at 10:41 am #2398790Alex
Okay, thanks for the clarification. Do I need to manually account for the customizer changeset UUID in my own code?
November 2, 2022 at 6:58 pm #2399196Tom
Lead DeveloperLead DeveloperYou 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?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentNovember 3, 2022 at 6:43 am #2399984Alex
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!
November 4, 2022 at 7:06 pm #2402216Tom
Lead DeveloperLead DeveloperI 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.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.