timja / jenkins-gh-issues-poc-06-18

0 stars 0 forks source link

[JENKINS-67516] Text Boxes with certain html elements as text fail form submission #1785

Open timja opened 2 years ago

timja commented 2 years ago

Since updating the 2.303.1 we have been having an issue with updating one of our freestyle jobs that we just decided to dig into more.

Anytime the freestyle configuration form is submitted the submit fails with a "This site can’t be reached" error.

This job executes a python script that builds an HTML page. Currently we are using the "Execute Python Script" option and just pasting the script into the form. 

Turns out this is what it doesn't like an moving the script into git and just executing it our config form now saves.

Further playing around has shown me that if I paste this part of our script into pretty much any text box in Jenkins it causes the operation to fail.

function ReleaseMachine( machine ){$.ajax({url:"ajax.php?reserve=false&name="+machine, success: function(result){}});alert("Machine UnBlock request has been sent to server.. Please wait")}

We are satisfied with the current solution but it seems bad to me that anything placed inside a text box can cause the UI to fail.

I would guess this has something to do with Jenkins-62437 but have no proof of that thats just about the time it started failing.


Originally reported by conkers87, imported from: Text Boxes with certain html elements as text fail form submission
  • status: Open
  • priority: Minor
  • resolution: Unresolved
  • imported: 2022/01/10
timja commented 2 years ago

ianw:

Looks like you are using jobConfigHistory plugin. Are you posting the code in that text box or somewhere in the the job config itself?

timja commented 2 years ago

conkers87:

I did try the job config history as well as all of the execute script text boxes in the free style job as my second screen shot shows. I also used a couple text boxes in the manage Jenkins page and the config file plugin.