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

Plugin should give a more precise error description if articles cannot be exported #24

Open
BartChris opened this issue Jul 10, 2024 · 7 comments

Comments

@BartChris
Copy link

BartChris commented Jul 10, 2024

The export of articles might fail for different reasons, e.g. if the genre of the submission/article has the wrong category

if ($genre->getCategory() != GENRE_CATEGORY_DOCUMENT) {

The error message if something cannot be exported is always the same and indicates missing pdf or epub files. This is confusing if there is in fact a PDF but the export fails for other reasons.

if (!$this->canBeExported($submission, $issue, $galleys, $supplementaryGalleys)) {

msgstr "The article {$param} cannot be exported because it does not have a PDF or an EPUB galley."

Would it be possible to supply error messages which indicate what the actual problem is? Thanks a lot.

@ronste
Copy link
Contributor

ronste commented Jul 10, 2024

Hi @BartChris ,

I completely agree with you that any kind of error should be reported indicating the actual problem. What kind of problem did you observe that was not reported or reported by a misleading error message?

Can you provide more information on the actual type of error you observed?

The lines of code you referenced above should only filter out galleys of file types the DNB does not accept (e.g. HTML, XML, exe, sh, ...). The message indicates the type of files the DNB accepts.

The only other reason for filtering out galleys may be the IP filtering of remote galleys. But this is handled by a separate exception and should be corretly reported.

Otherwise this code has nothing to do with other errors that might prevent deposition of an article.

I am happy to discuss any improvments but I need more information on the actual error. Do you use remote galleys or IP filtering? Do you export supplementary files?

Best wishes,
Ronald

@BartChris
Copy link
Author

BartChris commented Jul 10, 2024

In our system we stumbled over the problem that the submission had the wrong category, so that check here failed:

if ($genre->getCategory() != GENRE_CATEGORY_DOCUMENT) {

The error message indicated a missing PDF, but the articles had the wrong category assigned.
Edit: So i am not sure wether wrong categories should just be silently ignored or wether a custom error message is necessary for them. The report of missing PDF files is just misleading.

@ronste
Copy link
Contributor

ronste commented Jul 10, 2024

OK, I understand. So would it be sufficient to modify the error message like this:

"The article {$param} cannot be exported because it has no galley labeled as document or supplementray galley, or the galley type is not PDF or EPUB." ?

@BartChris
Copy link
Author

Thanks a lot. This sounds good. Would it maybe be more correct to say
"The article {$param} cannot be exported because it has no galley labeled as document, or the galley type is not PDF or EPUB." ?
because it is not enough to just provide a supplementray galley as return (count($galleys) > 0); will still evaluate to 0.
Greetings
Christoph

@ronste
Copy link
Contributor

ronste commented Jul 10, 2024

This error message is shown for both document galleys and supplementary galleys. What about:

"The article {$param} (or one of its supplementary galleys) cannot be exported because it has no galley file labeled as document or the file type of the galley or supplementary galley is not PDF or EPUB."

@BartChris
Copy link
Author

Sounds good!

@ronste
Copy link
Contributor

ronste commented Jul 10, 2024

I updated the locales on the 3.3 and 3.4 branches. The changes will be distributed with the next releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants