(RESOLVED) [OJS 3.1.0.1]Can't Delete an active submission. Error: "TypeError: b is undefined"

Hi, I’m trying to delete an active submission, but im getting this error in console:
image

The message in the ajax pop up says: “There was an unexpected error, please reload the page, if the error continues, contact the technical support.”

After I close the window, this message keeps showing until I reload the page:
image

This is the article I want to delete, it was just an old test in the application.
My OJS version is 3.1.0.1
My web server is IIS 7.5.

image

Many Thanks to you all

Hi @Kaleb_Lucas,

Are there any relevant entries in PHP logs associated with this delete operation?

1 Like

Hi @Vitaliy, unfortunely no. My log files don’t show anything about this Delete http request. The path is E:\Temp\php-5.6.31_erros.log.

I think its the only log file I have, and it only display logs about the server and url return, like 404 Not Found

Obs:
image

Yes, not much information here.

I suspect that one of the required field for the submission is missing?

Do you have access to the database? Can you find the submission by id in the submissions table and look what field is missing there? E.g., it can be section_id and if you assign one (from already existing) it should resolve the problem. If you are planning to do any manipulations with the database, don’t forget to make a back-up, and, basically, I don’t recommend manually delete submission directly from the database.

1 Like

Ok,
I just made a select in my submissions database, this is the result:
image

The section_id has a value assigned, so I don’t think this is the problem.
Comparing to other submissions, the only main difference is the number of pages. My problematic article has no pages.

Thanks

That’s OK since it’s not published.
Can you check if section_id 3 really exists (sections table) and journal with id 3 exists (journals table)?

1 Like

Just made the check, and yes this id exists and its in the right path (path column) and it is enabled.
Do you think it’s a HTTP request problem?

Hmm, I have no idea where the problem is. Maybe @asmecher knows more.

1 Like

Hi all,

@Kaleb_Lucas, can you double-check your PHP error log? The log you quoted above looks like your Apache access log, which is different.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Hello guys,
@asmecher, I retried the “delete submission”, reloaded my log file, but still doesn’t show anything about it.
This is the file I’m checking, is it correct? It really looks like an Apache log file, but we are using IIS as host, so, it can’t be.
image

Many thanks!

Hi @Kaleb_Lucas,

Hmm, it’s strange that this log contains so little in the way of warning/error messages. Can you check your IIS access log for the “delete submission” request and see what response code it delivered?

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Hello @asmecher,
We managed to discover the problem. Our application in IIS was not mapping the DELETE request in Handle Mapping option.

Many thanks for the support.

Hi @Kaleb_Lucas,
How did you find out the mapping error and how did you fix it?

I can’t delete any submission too.

I had an issue with DELETE and PUT requests.
Finally it turned out that following server configuration: Nginx as proxy for Apache in background will cause this problem. It is related to Nginx configuration settings.
my OJS 3.2.0.3 is on shared hosting and I have no access to Nginx settings as so. Nginx is returning 403 status on DELETE and PUT requests, but serves without problem the GET and POST.

SOLUTION (Workaround): Idea came up after reading following stackoverflow solution
Then, small dig into Slim framework, section Request > Headers, and there is an override the HTTP request method by using X-Http-Method-Override
So, using this method I have updated DELETE and PUT request methods in build.js. Plus, there is a section related to PKPForm which should be adjusted too.
Example:
deleteSubmission:function()
{
this.mask=“deleting”;var e=this;
$.ajax(
{
url:this.apiUrl+"/"+this.item.id,
type:“POST”,
headers:{
“X-Csrf-Token”:this.csrfToken,
“X-Http-Method-Override”:“DELETE”
},
error:this.ajaxErrorCallback,
success:function(){
e.mask=“finish”,
setTimeout((function(){
pkp.eventBus.$emit(“submissionDeleted”,{id:e.item.id}),e.cancelDeleteRequest()}),300)
},
complete:function(){
“deleting”===e.mask&&e.cancelDeleteRequest()
}
}
)
}

What server configuration you have?

@ssalavat Thanks for the help now it’s working… :kissing_heart:

Glad it helped you. :+1: