Make WordPress Core

Opened 17 months ago

Last modified 17 months ago

#57284 new defect (bug)

IMG tag in Custom HTML widget and also in post made w/ Classic Editor causes 404 on save/update

Reported by: blakespot's profile blakespot Owned by:
Milestone: Awaiting Review Priority: normal
Severity: major Version: 6.1.1
Component: Widgets Keywords:
Focuses: javascript, administration, rest-api Cc:


I am running two blogs, both with the latest version of WordPress, 6.1.1. (I first noticed this on my previous version installed, 6.0.3 but have since updated, which did not solve the problem.)

This issue exists on both WordPress installs I am running, to be clear.

No need to walk through my discovery process here, but I noticed I could not save and edit I made to an existing Custom HTML widget - it would just sit w/ the save gif spinning. I noticed in the console it threw a "Failed to load resource: the server responded with a status of 404 (Not Found)". I then created a new test Custom HTML widget and it saved and was editable no problem. Much experimenting later, I found that the presence of a standard HTML "img" tag broke the save. I added full alt, title, src attribs to the tag - no change. I even used a blank "img" tag with no attribs at all -- the save still broke. 404.

I had earlier run across an inability to edit and save old posts created with the Classic HTML plug-in, which was something I used to do all the time. I could create a new post and save it and edit it fine. Seemed odd. I just went back and added an "img" tag to the post and -- boom -- "page not found." Same issue, it seems. That's why I could not save my edit of the old posts -- all of them have an "img" tag or two in them.

It seems that the presence of such a tag causes the AJAX submit to be corrupted somehow. The error, on Widget save, points to the file admin-ajax.php. I will attach a screenshot of the situation, for what it's worth.

I can't say when this issue (which seems the same issue, to me as a web developer, between the two different examples here) began, but I've certainly edited content in the above fashion without incident in the past year. Right now I cannot edit or create Custom HTML widgets with images, and must -- for posts -- resort to using the block editor on the classic posts and dealing with the less-than-ideal HTML Source view it presents to make edits.

Many thanks and I do hope this can soon be resolved.

Attachments (1)

Screenshot 2022-12-06 at 10.45.42 AM.png (514.4 KB) - added by blakespot 17 months ago.
Screenshot of frozen Custom HTML widget attempting to save content, and the inspector console showing the JS error due to IMG tag

Download all attachments as: .zip

Change History (3)

17 months ago

Screenshot of frozen Custom HTML widget attempting to save content, and the inspector console showing the JS error due to IMG tag

#1 @blakespot
17 months ago

( I _am_ aware that one can edit posts created in the pre-block-editor beforetime with the Block Editor which comes up showing the classic post, but I prefer the Classic Editor's presentation of such posts. )

#2 @blakespot
17 months ago

UPDATE: I have just verified with testing assistance that disabling "Widget Options" plugin (which has a Classic view of the Widget system that I was using), I can now edit widgets fine -- those with "img" tags WILL save now.

-However-, the classic editor update / save -still- breaks for me when an "img" tag is present in the post. This may or may not be an additional clue. Thanks.

Note: See TracTickets for help on using tickets.