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
SEO: Title format editor won't save "remove custom formatting" #10003
Comments
refs 8620-chat |
Thanks for reporting this @nosolosw - I suspect that I know exactly what's happening… the absence of settings updates are considered as no-requests to change the data. If the field is blank, it probably thinks we're not sending any changes. @vindl did we ever settle on a way to "reset to default" and clear the fields? |
@dmsnell The current way to reset to default is to set a corresponding title format to empty string. |
I dug into this a bit, and I think there's a few things going wrong here:
@vindl maybe you can take a look? |
@dan I now noticed that my previous comment was not entirely true. In order to reset the particular title to default value, we should be passing an empty array. For example: {
"advanced_seo_title_formats": {
"pages": []
}
} Sending |
Yes, thanks! I need to figure out why the empty array that we set in Calypso never makes it to the api call. |
I've traced this all the way down in the request chain to where we send the Notice how the I guess a workaround could be to send an empty string instead of the empty array, and adjust the API to account for that. |
@vindl I forgot about this issue. Could we adjust the API to check for an empty string and then just save an empty array? |
@roundhill I'll have to investigate that. It could turn out to be tricky because that change would also affect Jetpack sites, and the UI could stop working on previous Jetpack versions (because of format validation in API). There is also a risk of introducing bugs on sites that have already saved option values in existing format. |
Previously, only arrays were considered as valid title formats, and in case of deletion we needed to provide empty array. Now, we are also allowing empty string to be passed in that case instead. This is needed to resolve the bug that prevented title deletion in Calypso. GitHub issue: Automattic/wp-calypso#10003
@roundhill I created an update for API side that will allow empty strings to be accepted, and modified the Calypso side to send them instead of empty arrays. That fixed the issue for me. |
* SEO Tools: Allow empty string to be passed as title format Previously, only arrays were considered as valid title formats, and in case of deletion we needed to provide empty array. Now, we are also allowing empty string to be passed in that case instead. This is needed to resolve the bug that prevented title deletion in Calypso. GitHub issue: Automattic/wp-calypso#10003 * yoda conditional
Still requires #13327 and D5298-code to be deployed, in addition to Automattic/jetpack#7044. |
Steps to reproduce as per #user-report
The user also mentioned this workaround: "I removed the tags and then entered 2 spaces and saved. It seems to save the 2 spaces.".
I could reproduce the issue and it happens for all sections (front page, posts, etc).
The text was updated successfully, but these errors were encountered: