SebastianP Posted April 3, 2023 Posted April 3, 2023 Hi, when I try to upload an image with non-Superuser role, the spinner does nor disappear and the upload dont get finished. I get an error in .../wire/modules/Inputfield/InputfieldImage/InputfieldImage.min.js: "VM1186:1 Uncaught SyntaxError: Unexpected token '<', "<script>"... The message which is returned as XHP-response is: <script> $(document).ready(function() { $("#_ProcessPageEditViewDropdown").remove(); }); </script> And this breaks the json parsing of this response. What's going wrong here? Thank you, best regards Sebastian
flydev Posted April 4, 2023 Posted April 4, 2023 Hi, we need more details. Modules, Version, logs, etc. Essentially this sort of issue arise when html markup is returned before the JSON result expected, then the xhr fail. My bet is that you have a hook somewhere, do you have something related in ready.php or _init.php or admin.php ? 2
SebastianP Posted April 4, 2023 Author Posted April 4, 2023 I've found the reason. The module "Restrict Tab View", especially the activation of the "tab-view-hide"-permission causes this behaviour. After deactivting this option, the upload works again. Best regards Sebastian 3
flydev Posted April 4, 2023 Posted April 4, 2023 @SebastianP if you really need the module, you can try to check xhr (I can't confirm the behavior..): if (!$this->config->ajax) { // add this if(in_array('View', $this->hiddenTabs)) { $event->return .= ' <script> $(document).ready(function() { $("#_ProcessPageEditViewDropdown").remove(); }); </script>'; } } // <-- add this https://github.com/adrianbj/RestrictTabView/blob/88bbee5a1fbf9a52e16df8573c0a243ee9feca97/RestrictTabView.module.php#L72-L79 2
adrian Posted April 7, 2023 Posted April 7, 2023 Thanks for the fix @flydev - I've added it to the latest version. 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now