icecoder/ICEcoder

Unable to save after copy past - not always but most of the time

alloona opened this issue · 2 comments

(ICECoder 8.1)
Describe the bug
When selecting text from one file and pasting it into a second (all within the editor), it appears to work; however, attempting to save the file after the copy/paste will usually, but not always, fail to save.

To Reproduce
Steps to reproduce the behavior:

  1. Open two files in code editor
  2. Select some code in the first page and copy with CTRL + C
  3. Past the code into second page using CTRL + V
  4. Save the code in the second page
  5. Usually produces error: Sorry but there was an error with your request. Please check your dev tools console for more info.

Screenshot 2022-06-05 10 43 45 AM

Clicking on the first error produces:
{ "file": { "absPath": "", "relPath": "/", "name": "", "path": "", "bytes": "", "modifiedDT": "1000000", "type": "unknown", "exists": false }, "action": { "initial" : "save", "final" : "nothing", "timeStart": 0, "timeEnd": 0, "timeTaken": 0, "csrf": "e945203a4621ae54db2ec5492e7d6c9c", "doNext" : "ICEcoder.switchMode();" }, "status": { "error" : true, "errorStr" : "true", "errorMsg" : "Sorry, bad filename provided. Check the dev tools console for more info?" } }

Clicking the 2nd error takes me to the editors \asseets\index page line 3695.

This does not always happen but happens more than 50% of the time. This forces me to make sure I save before pasting code so I do not lose my work.

If just creating or editing a page, without pasting anything, the page always saves with no problems.

Browser & Server (please complete the following information):

  • Browser: Chrom on chromebook and Firefox on MX linux.
  • Server: I am not sure how to determine this. My pages are on DreamHost,

I do have access to the site via terminal so if you need me to run any commands, please just list them step by step. Although I have done some programming in the past as a hobby, am by no means an expert and at this point, would not consider myself a very experienced user.

Here is an example of the code I just tried to paste and caused the problem:
<div class="wrapper"> <h2>Sign Up</h2> <p>Please fill this form to create an account.</p> <form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" method="post"> <div class="form-group"> <label>Username</label> <input type="text" name="username" class="form-control <?php echo (!empty($username_err)) ? 'is-invalid' : ''; ?>" value="<?php echo $username; ?>"> <span class="invalid-feedback"><?php echo $username_err; ?></span> </div> <div class="form-group"> <label>eMail</label> <input type="text" name="email" class="form-control <?php echo (!empty($email_err)) ? 'is-invalid' : ''; ?>" value="<?php echo $email; ?>"> <span class="invalid-feedback"><?php echo $email_err; ?></span> </div> <div class="form-group"> <label>Password</label> <input type="password" name="password" class="form-control <?php echo (!empty($password_err)) ? 'is-invalid' : ''; ?>" value="<?php echo $password; ?>"> <span class="invalid-feedback"><?php echo $password_err; ?></span> </div> <div class="form-group"> <label>Confirm Password</label> <input type="password" name="confirm_password" class="form-control <?php echo (!empty($confirm_password_err)) ? 'is-invalid' : ''; ?>" value="<?php echo $confirm_password; ?>"> <span class="invalid-feedback"><?php echo $confirm_password_err; ?></span> </div> <div class="form-group"> <input type="submit" class="btn btn-primary" value="Submit"> <input type="reset" class="btn btn-secondary ml-2" value="Reset"> </div> <p>Already have an account? <a href="login.php">Login here</a>.</p> </form> </div>

After doing more research, I found (I can't remember where) that I was receiving a status 418 error from the server. Searching this on google revealed that this was due to the extra security feature on dream host.

https://stackoverflow.com/questions/52340027/is-418-im-a-teapot-really-an-http-response-code

After turning off the extra security feature on DreamHost, the copy/paste is now working. This also solved another problem where I was not able to save changes made in settings.

I am leaving this up so that if anyone else experiences the same problem, they can find the solution. If it needs to be moved somewhere else, and you are able to, please do so.

Thank you for all your hard work and for such a great editor.

No probs and thanks for the update - that will help people searching here - I'll likely look to add this to https://icecoder.net/issues also.