Skip to content
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

[2018] Stop 500 error on page changes #6341

Merged

Conversation

smithellis
Copy link
Contributor

Updated wiki.js to retain form data between page changes
Also re-updates the revision list if there is data
Stops the 500 error

Copy link
Collaborator

@akatsoulas akatsoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall let's remove the debugging statements from the code. r+wc

$diffView.slideDown();
$this.parent().find('.close-diff').show();
$this.parent().find('.loading').hide();
console.log("Updating revision list with URL:", url); // Debugging output
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not needed

}, {});
localStorage.setItem('revision-list-filter', JSON.stringify(currentData)); // Save as JSON

console.log("Form data saved to localStorage:", currentData); // Debugging output
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same thing

});
// Retrieve and safely parse form data from localStorage
let formData = {};
const savedFormData = localStorage.getItem('revision-list-filter');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably a better option for the scenario at hand is the sessionStorage. Using sessionStorage will ensure that we won't have any stale data and we won't also exceed the capacity.

}
if (e.which === 13) {
e.preventDefault();
return false;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can skip the return statement here

Also re-updates the revision list  if there is data
Also stops the 500 error
use sessionStorage
@smithellis smithellis force-pushed the 2018-navigating-back-to-revision branch from 75d8d08 to 6b04957 Compare November 18, 2024 19:23
@smithellis smithellis merged commit c477deb into mozilla:main Nov 18, 2024
2 checks passed
@smithellis smithellis deleted the 2018-navigating-back-to-revision branch November 18, 2024 20:32
smithellis added a commit to smithellis/kitsune that referenced this pull request Dec 19, 2024
Also re-updates the revision list  if there is data
Also stops the 500 error
use sessionStorage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants