[Support request] option_generate_settings customizer error

Home Forums Support [Support request] option_generate_settings customizer error

Home Forums Support option_generate_settings customizer error

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #2379144
    Alex

    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.

    #2379172
    Ying
    Staff
    Customer Support

    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!

    #2380232
    Alex

    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!

    #2380630
    Tom
    Lead Developer
    Lead Developer

    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?

    #2384479
    Alex

    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!

    #2384798
    Tom
    Lead Developer
    Lead Developer

    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?

    #2390416
    Alex

    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.

    #2392275
    Tom
    Lead Developer
    Lead Developer

    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.

    #2398790
    Alex

    Okay, thanks for the clarification. Do I need to manually account for the customizer changeset UUID in my own code?

    #2399196
    Tom
    Lead Developer
    Lead Developer

    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?

    #2399984
    Alex

    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!

    #2402216
    Tom
    Lead Developer
    Lead Developer

    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.

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.